WordPress Тест Upwork часть 2

How would you extend the time of the WordPress login session?
       add_filter( ‘auth_cookie_expiration’, ‘stay_logged_in_for_1_year’ );
function stay_logged_in_for_1_year( $expire ) {
return 31556926; // 1 year in seconds}
       add_filter(‘auth_cookie’, ‘stay_logged_in_for_1_year’);
function stay_logged_in_for_1_year($expire) {
return 31556926;}
       add_filter(‘secure_logged_in_cookie’, ‘stay_logged_in_for_1_year’);
function stay_logged_in_for_1_year($expire) {
return 31556926;}
Which of these are a part of WordPress API?
Note: There may be more than one right answer.
       Theme Modification API
       Metadata API
       Theme Update API
       Settings API
       Options API
       Theme Customization API
       User API
       Update API
Which of the following is the correct way for enabling support for Post Thumbnails?
       add_theme_support( ‘thumbnails’ );
       add_support( ‘post-thumbnails’ );
       add_theme_support( ‘post-thumbnails’ );
       theme_support( ‘thumbnails’ );
Which concept does WordPress uses to control user access to different features?
       Username
       Access tokens
       Role
       Cookies
How do you enable the Network Setup menu item(enable Multisite) in WordPress?
       Install WP MU plugin
       Activate WP Multisite in Settings menu
       Set WP_ALLOW_MULTISITE as true in wp-config.php
       WP MU has been discontinued as a separate project so there is no way to set up multisites in WP now
Which constant is NOT recognized in wp-config.php?
       WP_SITEURL
       WP_CONTENT_DIR
       WP_CONTENT_URL
       WP_HOME_URL
Select all the default post types in WordPress.
Note: There may be more than one right answer
       post
       page
       attachment
       revision
       nav_menu_item
What is the default table prefix in WP?
       _wp
       w_
       wp_
       wp-
What is WordPress multisite?
       Special version of WordPress that can support many sites and is not free.
       WP configuration feature that supports multiple sites.
       A WP plugin that supports multiple sites.
       A popular WP theme that supports multiple sites.
Which is the most important file that should be deleted from your WordPress install directory once you’ve completed setup?
       setup-example.xml
       wp_config_sample.php
       wp-config-sample.php
       wp-setup-sample.php
Which files are a minimum required by a theme to function?
       style.css and functions.php
       style.css and index.php
       index.php and functions.php
       index.php, functions.php and style.css
How can an <li> tag’s class and ID attributes be removed from menu items and page lists?
       add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘nav_menu_item_id’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘page_css_class’, ‘my_css_attributes_filter’, 100, 1); function my_css_attributes_filter($var) { return is_array($var) ? array() : »; }
       add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘nav_menu_item_id’, ‘my_css_attributes_filter’, 100, 1); function my_css_attributes_filter($var) { if(is_array($var)){ $varci= array_intersect($var, array(‘current-menu-item’)); $cmeni = array(‘current-menu-item’); $selava = array(‘selectedmenu’); $selavaend = array(); $selavaend = str_replace($cmeni, $selava, $varci); } else{ $selavaend= »; } return $selavaend; }
       add_filter (‘wp_nav_menu’,’strip_empty_classes’); function strip_empty_classes($menu) { $menu = preg_replace(‘/ class=([«\’])(?!active).*?\1/’,»,$menu); return $menu; }
       None of the above
Which files are required for a theme to function?
       style.css, functions.php
       style.css, index.php
       index.php, functions.php
       index.php, functions.php, style.css
You need a single post meta value in a bigger post loop and you need it only one time, and you want it to be as fast as possible. How would you proceed?
       Of course, get_post_meta($post->ID, ‘post_meta’, true);
       I would use a direct query like: $wpdb->get_var($wpdb->prepare(«SELECT meta_value from $wpdb->postmeta WHERE post_id = %d and meta_key = ‘post_meta’”, $post->ID));
       I would use a direct query like: $wpdb->get_results($wpdb->prepare(«SELECT * from $wpdb->postmeta WHERE meta_key = %s”, ‘post_meta’));
Select all the default taxonomies in WordPress.
Note: There may be more than one right answer
       post_category
       post_tag
       link_category
       product_tag
       post_format
       category
How do you enable debug mode in WP?
       By going to Dashboard > Settings > General and then enable debug mode
       By setting WP_DEBUG as true in wp-config.php
       It is enabled by default
Where can you change the Timezone used by WordPress in the dashboard?
       In Settings > Media
       In Settings > General
       In Settings > Reading
       In Settings > Writing
What are the default plugins installed in the WordPress?
Note: There may be more than one right answer.
       Contact form7
       Akismet
       All in one SEO
       Hello Dolly
What is the name of self-hosted version of WordPress?
       WordPress.com
       WordPress.org
       Open Source WordPress
       WordPress online
Which default WP function can be used to assign different classes to the body element?
       body_class()
       get_theme_support()
       sanitize_html_class()
Which function(s) can be used to programatically create a new user in WordPress?
Note: There may be more than one right answer.
       wp_update_user
       wp_create_user
       register_new_user
       wp_insert_user
Retrieve all the post types that support thumbnails or excerpts.
       get_post_type(array(‘supports’ => array(‘thumbnail’, ‘excerpt’)), ‘names’, ‘or’);
       post_type_supports(‘post’, array(‘thumbnail’, ‘excerpt’), ‘or’);
       get_post_types_by_support(array(‘thumbnail’, ‘excerpt’), ‘or’);
Which of the following functions check if current visitor is a logged in user?
       is_visitor_logged_in ();
       is_user_logged_in ();
       if_user_logged_in ();
       is_user_logged ();
Is it possible to bypass trash and force deletion with wp_delete_post() function?
       No
       Yes
Which one of the following files is located in the root of your WordPress installation directory and contains your website’s setup details, such as database connection info?
       setup.html
       wp-setup.php
       wp-config.php
       wp-install.php
What type of hook is wp_meta
       Action Hook
       Filter Hook
How will you check if a page exists for a given URL?
       get_page_by_path()
       get_page_url()
       get_page_link()
       get_page_uri()
What can the Contributor role do?
       Moderate comments
       Publish posts
       Edit posts
       Edit pages
Is it possible to create posts programmatically?
       No
       Yes, with wp_insert_post() function
       Yes, with wp_add_post() function
       Yes, with wp_create_post() function
What is common to all these functions: next_post, previous_post, link_pages, the_author_url, wp_get_link?
       They all return URLs
       They are all deprecated
       They all point to posts or post lists
       They all echo something
How to display the value of a post meta field named my_custom?
       $post_meta = get_post_meta($post->ID, ‘my_custom’, true);
echo $post_meta;
       $post_meta = get_post_meta($post->ID);
echo $post_meta;
       echo get_meta($post->ID, ‘my_custom’);
Pick the correct default Post Types readily available to users or internally used by the WordPress installation.
Note: There may be more than one right answer.
       Post
       Page
       Blog
       Media
       Archive
       Category
Which of the following is incorrect possible value for $show attribute of bloginfo($show) function?
       ‘name’
       ‘description’
       ‘homeurl’
       ‘admin email’
Where can you set a static page as the front page in WP?
       In wp-config.php
       In Dashboard->Settings->Reading
       In Dashboard->Settings->General
       In Dashboard->Appearance
How you determine if a script has been enqueued correctly?
       has_enqueue_script(‘my-script-handle’);
       wp_script_is(‘my-script-handle’, ‘enqueued’);
       is_script_loaded(‘my-script-handle’);
How do you check if the current user has the role “administrator”?
Note: There may be more than one right answer.
       current_user_can_do(‘manage_options’);
       is_admin();
       current_user_can(‘administrator’);
       current_user_can_do(‘manage’);
       in_array(‘administrator’, wp_get_current_user()->roles);
What is the correct way for displaying navigation menu called “Primary Menu”?
       wp_nav_menu( array(
‘menu’ => ‘Primary Menu’) );
       wp_navigation_menu( array(
‘menu’ => ‘primary-menu’) );
       wp_navigation( array(
‘menu’ => ‘Primary Menu’) );
       wp_menu( array(
‘menu’ => ‘primary-menu’) );
Which of the following is true about bloginfo(‘url’); function?
       Displays URL of the active theme’s directory.
       Displays the “Site address (URL)” set in Settings > General. This data is retrieved from the “home” record in the wp_options table.
       Displays the current post URL.
       Displays the “WordPress address (URL)” set in Settings > General. This data is retrieved from the “siteurl” record in the wp_options table.
How do you know if a WordPress action has been previously fired?
       Using the has_action(‘my_action’) function.
       Using the did_action(‘my_action’) function.
       Using the current_filter function.
Clean up a comma-separated list of post ids. Example list: 1254,9930,10974,”192”,9930,192
       array_map(‘absint’, ’1254,9930,10974,”192”,9930,192’);
       explode(1254,9930,10974,”192”,9930,192);
       wp_parse_id_list(1254,9930,10974,”192”,9930,192);
What is the correct way to use the _n() function?
       printf( _n( ‘The post has 1 star.’, ‘The post has %d stars.’, $view_count ), $view_count );
       printf( _n( ‘The post has %d star.’, ‘The post has %d stars.’, $view_count ), $view_count );
How many WordPress posts can you create?
       WordPress recommends less than 10,000 posts.
       WordPress is limited to 1,000 posts.
       WordPress has not set any limit.
       WordPress is limited to 1,00,000 posts.
In which way MD5 hash does wordpress stores and represents?
       In Hex string
       In Base64 string
       in raw data file
       text file
Sometimes you might want to disable all the automatic background updates of WordPress, extensions, themes and languages. How would you accomplish that?
Note: There may be more than one right answer
       via a define in wp-config.php: define(‘AUTOMATIC_UPDATER_DISABLED’, true);
       with a filter: add_filter(‘automatic_updater_disabled’, ‘__return_true’);
       I’m using git, so I would use a special filter:
add_filter(‘automatic_updates_is_vcs_checkout’, ‘__return_false’, 1);
You need to include a link in a sentence. How can you do that?
       _e( ‘Publish something using our Post by Email feature.’ );
       printf( __( ‘Publish something using our Post by Email feature.’), ‘http://support.wordpress.com/post-by-email/’ );
       printf( __( ‘Publish something using our %s feature.’ ), sprintf( ‘%s’, __( ‘Post by Email’ ) ) );
Select all the WordPress supported audio formats.
Note: There may be more than one right answer
       aiff
       mp3
       ogg
       flac
       wma
       m4a
       wav
Assuming we are using ‘wp_’ as the database table prefix, in which table are all the custom fields related to a post stored?
       wp_posts
       wp_postmeta
       wp_terms
Is it possible to disable the trash and delete the posts immediatelly?
       No.
       Yes, via a define in wp-config.php: define(‘EMPTY_TRASH_DAYS’, 0);
       Yes, via a define in wp-config.php: define(‘EMPTY_TRASH_DAY’, 0);
Which is the default site update service that WordPress automatically notifies when you publish a new post?
       http://rpc.pingomatic.com
       http://google.com
       http://ping.feedburner.com
       http://www.feedsubmitter.com
Which of the following is not a WordPress role?
       System
       Subscriber
       Administrator
       Editor
Which of the following is not a default image size in WP?
       Small Size
       Medium Size
       Large Size
       Thumbnail Size
Which of the following is an example of a WordPress plugin that provides pagination capabilities?
       Page Break
       Page Generator
       WP-PageNavi
       Page-list
What is a permalink?
       Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings.
       The numeric IP address of your WordPress site.
       The complete URL of your WordPress site.
       A popular WordPress plugin.
Which from below are default post types in WordPress and are readily available to users or internally used by the WordPress installation by default:
Note: There may be more than one right answer
       Post
       Page
       Links
       Attachment
       Revision
       Comments
       Navigation menu
Which of the following is not a default user role in WP?
       Blogger
       Author
       Subscriber
       Contributor
What are WordPress hooks?
       Setting options available to WordPress administrators.
       Security functions that run inside WordPress
       Group of plugins which control WordPress behavior.
       Ways to change the default behavior of WordPress.
 How many WordPress themes can be installed in a single WordPress installation?
       1
       10
       100
       Unlimited
_____________ can publish, edit, and delete their own posts. They cannot write pages. They can upload some kinds of media files, and they are allowed to use only the limited set of HTML tags.
        a  Contributor
        b  Author
        c  Editor
        d  Subscriber
        e  Administrator
Which WP global object is used to execute custom database queries?
       $wpdb
       $wp_db
       $db_query
       $wp_query
Arrange the following templates in decreasing order of priority from left to right for Site Front Page:
index.php
front-page.php
home.php
       index.php, front-page.php, home.php
       front-page.php, home.php, index.php
       home.php, front-page.php, index.php
       front-page.php,index.php home.php
Is it possible to retrieve list of custom taxonomy terms with get_terms() function?
       Yes
       No
What database does WordPress use?
       Notes
       PostgreSQL
       MySQL
       Oracle
What is true about the_meta() function?
Note: There may be more than one right answer
       This is a function for displaying custom fields for the current post, known as the “post-meta” (stored in the wp_postmeta table).
       It formats the data into an unordered list.
       It may be used outside the loop.
       the_meta() will ignore meta_keys (i.e. field names) that begin with an underscore.
Which of the following files in a WP theme is NOT a file required by the theme review team for acceptance into the WordPress.org theme directory?
       page.php
       style.css
       index.php
       comments.php
       screenshot.png
Which of the following will change the default ordering of categories in the WordPress post edit page?
       Adding ‘checked_ontop’ => FALSE to the args in wp_terms_checklist() in the functions.php file
       Disabling category ordering in the WordPress admin settings
       Setting category_ordering=false in the wp-config.php file
       Adding ‘category_ordering’ => FALSE to the args in wp_terms_checklist() in the functions.php file
If you need to store information temporarily, which WordPress system would you use:
       Options
       Meta tables
       Transients
       The REST API
Select all of the supported page statuses in WordPress.
Note: There may be more than one right answer.
       draft (Draft)
       pending (Pending Review)
       private (Private)
       publish (Published)
Which of the following is the correct way to register shortcode?
       function foobar_func ( $atts ){return “foo and bar”;}new_shortcode( ‘foobar’, ‘foobar_func’ );
       function foobar_func ( $atts ){return “foo and bar”;}insert_shortcode( ‘foobar’, ‘foobar_func’ );
       function foobar_func ( $atts ){return “foo and bar”;}register_shortcode( ‘foobar’, ‘foobar_func’ );
       function foobar_func ( $atts ){return “foo and bar”;}add_shortcode( ‘foobar’, ‘foobar_func’ );
Which of the following strings is not a default WordPress post format slug?
       aside
       image
       quote
       status
Which HTML tags are not allowed to be used in a post comment?
Note: There may be more than one right answer
       code
       form
       img
       strike
       table
Which hook can be used to update kses and TinyMCE to allow select new attributes for an HTML element?
       tool_box
       tiny_mce_before_init
       tiny_mce_plugins
       htmledit_pre
What is the difference between filters and actions?
       An action is defined as a function that takes in some kind of input, modifies it, and then returns it whereas a filter is just a place where you call a function, and you don’t really care what it returns
       A filter is defined as a function that takes in some kind of input, modifies it, and then returns it whereas an action is just a place where you call a function, and you don’t really care what it returns
       There is no difference. Both are used for hooking into an action.
Where plugins options are stored in WordPress?
       They are stored in WordPress theme folder.
       They are stored in WordPress plugins folder.
       They are stored in WordPress.org and not on your site.
       They are stored in WordPress Database.
When is it recommended to rebuild the $wp_rewrite object with the flush_rewrite_rules() function?
       once in a while
       after every one hour
       on every custom post type page load
       after activatation and deactivation of a custom post types plugin
When adding a function to the “the_content” hook, where will you see changes?
       On the blog list page.
       On the single post page.
       It depends on how your theme is set up.
       On the archive page.
What is the WordPress way of adding a query variable to an URL
       site_url(‘?’ . $foo . ‘=’ . $bar);
       home_url(‘$’ . $foo . ‘=’ . $bar);
       add_query_arg($foo, $bar, home_url());
Which standard WP class do you need to necessarily extend to create your widget?
       WP_Widget
       WP_Widget_Form_Customize_Control
       WP_Customize_Control
       WP_Customize_Sidebar_Section
Display the current pagination number.
       $page = get_page(‘1’);
echo ‘Current page: ’ . $page->post_paged;
       $paged = get_query_var(‘paged’, 1);
echo ‘Current page: ’ . $paged;
       $page = get_post(‘1’);
echo ‘Current page: ’ . $page->post_paged;
Which of the following is true about wp_mail() function?
Note: There may be more than one right answer.
       A true return value does not automatically mean that the user received the email successfully.
       For this function to work, the settings SMTP and smtp_port (default: 25) need to be set in your php.ini file.
       The default content type allows using HTML.
       The function can handle only one email as $to parameter.
Which hook fires after WordPress has finished loading but before any headers are sent?
       activate_wp_head
       init
       activate_header
       xmirpc_call
What WordPress function would you use to retrieve the name of the current action?
       current_filter
       current_action_name
       current_hook
Which loop is used by default to fetch the posts and loop through them?
       for loop
       while loop
       foreach loop
“X people have seen this post” should be output like this:
       printf( _n( ‘%d person has seen this post.’, ‘%d people have seen this post.’, $view_count ), $view_count );
       printf( __( ‘%d people have seen this post.’ ), $view_count );
       echo _n( ‘One person has seen this post’, “$view_count people have seen this post.” );
       printf( _n( ‘%d person has seen this post.’, ‘%d people have seen this post.’ ), $view_count );
       printf( 1 == $view_count ? __( ‘%d person has seen this post.’ ) : __( ‘%d people have seen this post.’ ), $view_count );
Pick the default template tag(s).
Note: There may be more than one right answer.
       the_field()
       wp_title()
       the_title()
       wp_field()
When should the wp_kses function for Data Validation be run?
       At the time of form submission
       Before the data is saved in the database
       before the data is being rendered on the webpage
Arrange the following templates in decreasing order of priority from left to right used to display the posts on a Category page.
index.php
category.php
archive.php
category-ID.php
category-slug.php
       category-ID.php, category-slug.php, category.php, archive.php, index.php
       category-slug.php, archive.php, category.php, category-ID.php, index.php
       index.php, category.php, archive.php, category-ID.php, category-slug.php
       category-slug.php, category-ID.php, category.php, archive.php, index.php
How would you retrieve an array of all the post tags?
Note: There may be more than one right answer
       get_terms(‘post_tag’, array(‘hide_empty’ => false));
       get_terms(array(‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false));
       get_term();
       wp_terms()
       wp_terms_checklist();
Which function should be used to insert a post title into the title attribute of an HTML element?
       get_the_title();
       the_title_attribute();
       the_title();
What is the name of table in database which stores custom fields data?
       wp_custommeta
       wp_options
       wp_terms
       wp_postmeta
Which of the following is/are NOT the default abstract methods available in the Walker class for menus?
Note: There may be more than one right answer.
       start_lvl()
       end_lvl()
       start_li()
       end_li()
at does wp_rand() function?
       Gets random post ID.
       Gets random category ID.
       Generates a random post ID for wp_insert_post() function.
       Generates a random number
Which deprecated functions are still in use in WordPress?
       register_globals()
       magc_quotes()
       addslashers()
       get_permalink()
Is it possible to update posts programmatically?
       Yes, with wp_edit_post() function.
       Yes, with wp_update_post() function.
       Yes, with wp_change_post() function.
       No.
Which of the following categories of persons can read a post locked by password?
       Only administrators, editors and authors.
       Registered users who know a password.
       Anyone who knows a password
Where do you change theme name and author details?
       style.css file in the theme folder
       index.php file in the theme folder
       readme.txt file in the theme folder
In a WordPress multisite, how can a new blog site be added from the Network Admin panel?
       add_action( $tag, $function_to_add, $priority, $accepted_args);
       define (‘WP_ALLOW_MULTISITE’, true);
       do_action (‘wpmu_blog’, $blog_id, $user_id, $domain, $path, $site_id, $meta);
       do_action (‘wpmu_new_blog’, $blog_id, $user_id, $domain, $path, $site_id, $meta);
What is the correct order of priority in decreasing order from left to right for Custom Post Type template files?
       single-{post-type}-{slug}.php, single-{post-type}.php, single.php, singular.php, index.php
       single-{post-type}.php, single-{post-type}-{slug}.php, single.php, singular.php, index.php
       single-{post-type}.php, single.php, singular.php, single-{post-type}-{slug}.php, index.php
       index.php, singular.php, single-{post-type}-{slug}.php, single-{post-type}.php, single.php
What is Automated Testing in WordPress?
       Automated testing is running test cases where manual intervention is not required to run each one.
       It is a plugin which is used to test your custom template or plugin.
       It is a function available in WordPress to test the custom template/plugin.
       Thereess.
What is the name of theme file for a page with slug ‘about’?
        a  page-slug-about.php
        b  page-about.php
        c  about.php

WordPress Test часть 1

WordPress Тест Upwork 2019