Upwork WordPress Test 2016......
70 Answered Test Questions:
1. Which of the following will hash a string/password to its md5 equivalent?
Answers:
a. md5()
b. wp_generate_password()
c. wp_generate_md5()
d. password_md5()
a. md5()
b. wp_generate_password()
c. wp_generate_md5()
d. password_md5()
2. Which conditional tag checks if the dashboard or the administration panel is attempting to be displayed by returning “true’ (if the URL being accessed is in the admin section) or “false” (for a front-end page).
Answers:
a. my_admin()
b. view_admin()
c. is_admin()
d. root_admin()
a. my_admin()
b. view_admin()
c. is_admin()
d. root_admin()
3. Which of the following functions are used to add administration menu item in WordPress ?
Answers:
a. add_menu_page();
b. add_admin_item();
c. add_admin_page();
d. add_admin_option();
a. add_menu_page();
b. add_admin_item();
c. add_admin_page();
d. add_admin_option();
4. Which of the following WordPress Multisite functions allows for getting content from one blog and display it on another?
Answers:
a. switch_blog()
b. switch_to_blog()
c. restore_current_blog()
d. restore_to_current_blog()
a. switch_blog()
b. switch_to_blog()
c. restore_current_blog()
d. restore_to_current_blog()
5. What is the BEST way to get last inserted row ID from WordPress database ?
Answers:
a. Use the following code snippet $lastid->$wpdb=$last->get_row;
b. The call to mysql_insert_id() inside a transaction should be added: mysql_query(‘BEGIN’); // Whatever code that does the insert here. $id = mysql_insert_id(); mysql_query(‘COMMIT’); // Stuff with $id.
c. The following code snippet should be added $last = $wpdb->get_row(“SHOW TABLE STATUS LIKE ‘table_name'”); $lastid = $last->Auto_increment;
d. Straight after the $wpdb->insert() insert, the following code should be added: $lastid = $wpdb->insert_id;
a. Use the following code snippet $lastid->$wpdb=$last->get_row;
b. The call to mysql_insert_id() inside a transaction should be added: mysql_query(‘BEGIN’); // Whatever code that does the insert here. $id = mysql_insert_id(); mysql_query(‘COMMIT’); // Stuff with $id.
c. The following code snippet should be added $last = $wpdb->get_row(“SHOW TABLE STATUS LIKE ‘table_name'”); $lastid = $last->Auto_increment;
d. Straight after the $wpdb->insert() insert, the following code should be added: $lastid = $wpdb->insert_id;
6. Which of the follow is a WordPress alternatives for Ruby on Rails?
Answers:
a. Refinery
b. Typof
c. Symenta
d. Rubyalt
a. Refinery
b. Typof
c. Symenta
d. Rubyalt
7. Which of the following code snippets can be used to create custom POST status in wordpress 3.0 +?
Answers:
a. register_new_post()
b. register_post_status()
c. add_new_post_status()
d. modify_post_status()
a. register_new_post()
b. register_post_status()
c. add_new_post_status()
d. modify_post_status()
8. How can the upload media panel be included in a WordPress template/plugin?
Answers:
a. By using function wp_enqueue_script(‘media-upload’)
b. By using function wp_add_media( );
c. By using function wp_enqueue_script(‘upload’);
d. By using function wp_add_script(‘media-upload’);
a. By using function wp_enqueue_script(‘media-upload’)
b. By using function wp_add_media( );
c. By using function wp_enqueue_script(‘upload’);
d. By using function wp_add_script(‘media-upload’);
9. What are the database privileges that are required for WordPress?
Answers:
a. insert, delete, update, drop and alter
b. select, insert, delete, update, create, drop and alter
c. insert, delete, update, create, drop and alter
d. insert and delete
a. insert, delete, update, drop and alter
b. select, insert, delete, update, create, drop and alter
c. insert, delete, update, create, drop and alter
d. insert and delete
10. Which of the following is an example of a WordPress plugin that provides multilingual capabilities?
Answers:
a. WP Super Cache
b. qTranslate
c. BuddyPress
d. Hotfix
a. WP Super Cache
b. qTranslate
c. BuddyPress
d. Hotfix
11. Which of the following functions can be used to create a WordPress page?
Answers:
a. wp_insert_post()
b. wp_insert_page()
c. wp_create_post()
d. wp_create_page()
a. wp_insert_post()
b. wp_insert_page()
c. wp_create_post()
d. wp_create_page()
12. Which function is used to display the name of current page in wordpress?
Answers:
a. get_the_title()
b. content_title()
c. page_name()
d. post_name()
a. get_the_title()
b. content_title()
c. page_name()
d. post_name()
13. Which of the following methods can be used to make permalinks SEO friendly?
Answers:
a. Updating the database.
b. Changing the source code.
c. Configuring the feature in the config file.
d. Configuring the feature in the admin settings.
a. Updating the database.
b. Changing the source code.
c. Configuring the feature in the config file.
d. Configuring the feature in the admin settings.
14. User Level 7 converts to _________?
Answers:
a. Contributo
b. Autho
c. Edito
d. Subscribe
e. Administrato
a. Contributo
b. Autho
c. Edito
d. Subscribe
e. Administrato
15. Which of the following is the correct way to add custom excerpts length identifiers in WordPress?
Answers:
a. By adding excerpt_length filter in function.php
b. Can’t declare custom excerpts in wordpress
c. Custom exceprts are already available in wordpress
d. Using the_excerpt(‘long’); or the_excerpt(‘short’)
a. By adding excerpt_length filter in function.php
b. Can’t declare custom excerpts in wordpress
c. Custom exceprts are already available in wordpress
d. Using the_excerpt(‘long’); or the_excerpt(‘short’)
16. Which of the following is the correct sequence of steps to adapt a WordPress plugin to a multisite?
Answers:
a. 1. Use $wpdb to iterate through all blogs 2. Hook according to the $blog_id 3. Install the plugin as Network only 4. Uninstall depends the specific plugin
b. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. IInstall the plugin as Network only 4. Uninstall depends the specific plugin
c. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install other activations except Network 4. Uninstall is the same for all the plugins
d. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install the plugin as Network only 4. Uninstall is same for all the plugins
a. 1. Use $wpdb to iterate through all blogs 2. Hook according to the $blog_id 3. Install the plugin as Network only 4. Uninstall depends the specific plugin
b. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. IInstall the plugin as Network only 4. Uninstall depends the specific plugin
c. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install other activations except Network 4. Uninstall is the same for all the plugins
d. 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install the plugin as Network only 4. Uninstall is same for all the plugins
17. On which of the following databases can WordPress be installed by default?
Answers:
a. MySQL
b. Oracle Database
c. Microsoft SQL Server
d. PostgreSQL
a. MySQL
b. Oracle Database
c. Microsoft SQL Server
d. PostgreSQL
18. Which of the following actions must be performed to import data from wordpress.com?
Answers:
a. Enter the full access to wordpress.com into the data import form so that it can automatically connect and directly retrieve content.
b. Import from wordpress.com’s RSS.
c. Login to wordpress.com, then the export data using the export tool, then import an exported xml file to the site.
a. Enter the full access to wordpress.com into the data import form so that it can automatically connect and directly retrieve content.
b. Import from wordpress.com’s RSS.
c. Login to wordpress.com, then the export data using the export tool, then import an exported xml file to the site.
19. Meta tags can be added to WordPress pages by ________________.
Answers:
a. using plug-ins
b. adding them to the header.php file
c. updating the database
d. a and
e. and c
a. using plug-ins
b. adding them to the header.php file
c. updating the database
d. a and
e. and c
20. Which of the following codes will return the current plugin directory in WordPress?
Answers:
a.
b.
c.
d.
a.
b.
c.
d.
21. WordPress’s requirements are modest. At minimum, which of the following standards should your server support for WordPress 3.1?
Answers:
a. PHP version 4.4.9 or greater, MySQL version 4.0 or greater
b. PHP version 4.3 or greater, MySQL version 4.1.2 or greater
c. PHP version 4.4.9 or greater, MySQL version 5.1 or greater
d. PHP version 4.3 or greater, MySQL version 5.1 or greater
a. PHP version 4.4.9 or greater, MySQL version 4.0 or greater
b. PHP version 4.3 or greater, MySQL version 4.1.2 or greater
c. PHP version 4.4.9 or greater, MySQL version 5.1 or greater
d. PHP version 4.3 or greater, MySQL version 5.1 or greater
22. Which of the following will give the option to add inline Ajax for comment posting?
Answers:
a. Enabling Ajax in the wp-config.php file
b. Activating Ajax from the admin settings of WordPress
c. Using the Ajax Comment Posting plugin
d. WordPress doesn’t support inline Ajax.
a. Enabling Ajax in the wp-config.php file
b. Activating Ajax from the admin settings of WordPress
c. Using the Ajax Comment Posting plugin
d. WordPress doesn’t support inline Ajax.
23. What is the limitation to the depth of your categories?
Answers:
a. 10 levels
b. 20 levels
c. No limit levels
a. 10 levels
b. 20 levels
c. No limit levels
24. Can the contents of the wp-content folder be moved or renamed without changing any settings?
Answers:
a. Yes
b. No
a. Yes
b. No
25. Which of the following code snippets best protects a system from SQL injections?
Answers:
a. sql_real_escape_strong()
b. mysql_real_escape()
c. mysql_real_escape_string()
d. mysql_not_real_delete_string()
a. sql_real_escape_strong()
b. mysql_real_escape()
c. mysql_real_escape_string()
d. mysql_not_real_delete_string()
26. Which of the following role levels has the highest privilege?
Answers:
a. Level_0
b. Level_10
c. Depends on your settings.
d. Every role level has the same privilege.
a. Level_0
b. Level_10
c. Depends on your settings.
d. Every role level has the same privilege.
27. How can the Home link be disable from the WordPress top nav?
Answers:
a. Using Jquery to hide it
b. By adding this code in functions.php function page_menu_args( $args ) { $args[‘show_home’] = FALSE; return $args; } add_filter( ‘wp_page_menu_args’, ‘page_menu_args’ );
c. wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ => false))
d. Can not disable the default Home link from wordpress top nav
a. Using Jquery to hide it
b. By adding this code in functions.php function page_menu_args( $args ) { $args[‘show_home’] = FALSE; return $args; } add_filter( ‘wp_page_menu_args’, ‘page_menu_args’ );
c. wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ => false))
d. Can not disable the default Home link from wordpress top nav
28. Which of the following is the correct way to retrieve a featured image from a post?
Answers:
a.
b.
c.
d.
a.
b.
c.
d.
29. Which of the following will correctly load localized (translated) text for a WordPress plugin?
Answers:
a. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
b. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
c. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir);
d. function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
a. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
b. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
c. function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir);
d. function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
30. Image size limits can be set _______________.
Answers:
a. directly in the posts
b. in the wp-imageresize plug-in
c. in the admin settings
d. a and
a. directly in the posts
b. in the wp-imageresize plug-in
c. in the admin settings
d. a and
31. How can a user be found through its meta data?
Answers:
a. User can not be retrieved through its meta data
b. get_user_by_metadata($metaid,$metavalue)
c. get_user($args)
d. get_users($args)
a. User can not be retrieved through its meta data
b. get_user_by_metadata($metaid,$metavalue)
c. get_user($args)
d. get_users($args)
32. Which PHP method(s) can be used to send form data that is persistent across succeeding page views (such as for a language selection feature) in WordPress?
Answers:
a. POST
b. GET
c. SESSION or COOKIE
d. POST or GET
a. POST
b. GET
c. SESSION or COOKIE
d. POST or GET
33. Which of the following will call the WordPress media uploader form element?
Answers:
a.
a.
$tags = wp_get_post_tags($post->ID);
$firstTag = $tags[0];
$firstTag = $tags[0];
Answers:
a. $firstTag[‘slug’];
b. $firstTag->slug
c. $firstTag.slug
d. $firstTag[0][‘slug’]
a. $firstTag[‘slug’];
b. $firstTag->slug
c. $firstTag.slug
d. $firstTag[0][‘slug’]
35. Which of the following code snippets is the correct way to get content from Tinymce via javascript ?
Answers:
a. document.getElementById(‘content’)
b. tinymce.activeEditor.getContent();
c. tinymce.element.getContent();
d. document.getElement(‘tinymce_content’)
a. document.getElementById(‘content’)
b. tinymce.activeEditor.getContent();
c. tinymce.element.getContent();
d. document.getElement(‘tinymce_content’)
36. Is super cache a built-in plugin of WordPress?
Answers:
a. Yes
b. No
a. Yes
b. No
37. A possible way to allow the display of several authors’ names on one post is to ______
Answers:
a. update the database
b. change the admin settings
c. change the config files
d. use a plug-in
a. update the database
b. change the admin settings
c. change the config files
d. use a plug-in
38. In which way MD5 hash does wordpress stores and represents?
Answers:
a. In Hex string
b. In Base64 string
c. in raw data file
d. text file
a. In Hex string
b. In Base64 string
c. in raw data file
d. text file
39. What is the first action you need to take for enabling WordPress MU feature?
Answers:
a. Enable WordPress MU feature on admin panel
b. Enable Network feature
c. Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
a. Enable WordPress MU feature on admin panel
b. Enable Network feature
c. Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
40. What is Automated Testing in WordPress?
Answers:
a. Automated testing is running test cases where manual intervention is not required to run each one.
b. It is a plugin which is used to test your custom template or plugin.
c. It is a function available in WordPress to test the custom template/plugin.
d. There is no such thing as Automated Testing in WordPress.
a. Automated testing is running test cases where manual intervention is not required to run each one.
b. It is a plugin which is used to test your custom template or plugin.
c. It is a function available in WordPress to test the custom template/plugin.
d. There is no such thing as Automated Testing in WordPress.
41. You can limit the number of revisions WordPress stores by _____
Note: Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can’t assign them the same slug.
Answers:
a. adding the following line to your wp-config.php file: define(‘WP_POST_REVISIONS’, 3);
b. using a plugin
c. changing a setting on admin panel
a. adding the following line to your wp-config.php file: define(‘WP_POST_REVISIONS’, 3);
b. using a plugin
c. changing a setting on admin panel
42. Which of the following snippets disable depreciated warnings in WordPress like this one ?
“Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647”
Answers:
a. define(E_DEPRECATED, false);
b. error_reporting(E_ALL ^ E_DEPRECATED);
c. define(E_NOTICE, false);
d. error_reporting(WP_DEBUG, true)
a. define(E_DEPRECATED, false);
b. error_reporting(E_ALL ^ E_DEPRECATED);
c. define(E_NOTICE, false);
d. error_reporting(WP_DEBUG, true)
43. One possible way to collect realtime statistics about traffic on a WordPress site is:
Answers:
a. using a built-in tool
b. using a plugin
c. using a widget
d. Traffic statistics cannot be collected on a WordPress site.
a. using a built-in tool
b. using a plugin
c. using a widget
d. Traffic statistics cannot be collected on a WordPress site.
44. _____________ 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.
Answers:
a. Contributo
b. Autho
c. Edito
d. Subscribe
e. Administrato
a. Contributo
b. Autho
c. Edito
d. Subscribe
e. Administrato
45. How can an
- tag’s class and ID attributes be removed from menu items and page lists? Answers:
a. 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() : ”; }b. add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 100, 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; }b. add_filter (‘wp_nav_menu’,’strip_empty_classes’); function strip_empty_classes($menu) { $menu = preg_replace(‘/ class=([“\’])(?!active).*?\1/’,”,$menu); return $menu; }c. None of the above46. ____________ can publish, edit, and delete posts and pages written by any user. They can upload some kinds of files, and they can write HTML without restrictions. They can manage links and categories, and they can moderate comments. Editors and administrators are also the only users allowed to read private posts and pages.Answers:
a. Contributor
b. Author
c. Editor
d. Subscriber
e. Administrator47. Which of the following will show the most recent post (by date) from a custom taxonomy?Answers:
a. select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_term_taxonomy as c on (b.term_taxonomy_id = c.term_taxonomy_id) join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)b. select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)c. select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_term_taxonomy as c on (b.term_taxonomy_id =d.term_taxonomy_id) join wp_terms as d on (c.term_id = d.term_id) having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)f. select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)48. What are the correct steps in wordpress plugin development:Answers:
a. Step 1 – Create your file and let it be known as a plugin Step 2 – Create the objects of your plugin Step 3 – Adding your actions and filters Step 4 – Adding settings/options to your plugin Step 5 – Finishing the code
b. Step 1 – Adding settings/options to your plugin Step 2 – Create your file and let it be known as a plugin Step 3 – Create the objects of your plugin Step 4 – Adding your actions and filters Step 5 – Finishing the code
c. Step 1 – Create the objects of your plugin Step 2 – Adding settings/options to your plugin Step 3 – Create your file and let it be known as a plugin Step 4 – Finishing the code
d. Step 1 – Create the objects of your plugin Step 2 – Adding settings/options to your plugin Step 3 – Finishing the code49. What is the output of the following code?
a. example 1
b. example 2
c. example 3
d. example 4
b. example 2
c. example 3
d. example 4
$(document).ready(function(){
$(‘#sortable’).sortable({
update: function(event, ui) {
var newOrder = $(this).sortable(‘toArray’).toString();
$.get(‘saveSortable.php’, {order:newOrder});
}
});
});
$(‘#sortable’).sortable({
update: function(event, ui) {
var newOrder = $(this).sortable(‘toArray’).toString();
$.get(‘saveSortable.php’, {order:newOrder});
}
});
});
Answers:
a. Removes positions from data base based on the user input
b. Saves sortable positions to data base based on the user input
c. Adding new sortable positions from another data base
d. Sorting out existing positions without updating the data base with the new user inputs
a. Removes positions from data base based on the user input
b. Saves sortable positions to data base based on the user input
c. Adding new sortable positions from another data base
d. Sorting out existing positions without updating the data base with the new user inputs
50. Which of the following is the correct way to assign a category to a WordPress post?
Answers:
a. wp_set_post_categories($postId,$categories)
b. wp_set_category($catId,$postId)
c. By XML-RPC call to wpc.newPost
d. This is not possible
a. wp_set_post_categories($postId,$categories)
b. wp_set_category($catId,$postId)
c. By XML-RPC call to wpc.newPost
d. This is not possible
51. Conditional tags can be used to _______________________.
Answers:
a. get all comments from one post
b. get all posts from one category
c. change the content to be displayed
d. None of the above: conditional tags are not available in WordPress.
a. get all comments from one post
b. get all posts from one category
c. change the content to be displayed
d. None of the above: conditional tags are not available in WordPress.
52. Which of the following commands can change the ownership of WordPress directory to www-data (for Apache)?
Answers:
a. sudo chown -Rf www-data *
b. chown -Rf www-data *
c. sudo crown -Df www-data *
d. Alldo chown -Rf www-data *
a. sudo chown -Rf www-data *
b. chown -Rf www-data *
c. sudo crown -Df www-data *
d. Alldo chown -Rf www-data *
53. How can a custom content filter be added?
Answers:
a. By using add_action(‘the_content’,’my_custom_filter’)
b. By using add_filter(‘the_content’,’my_custom_filter’)
c. By using wp_filter(‘the_content’,’my_custom_filter’)
d. By using add_action(‘content’,’my_custom_filter’)
a. By using add_action(‘the_content’,’my_custom_filter’)
b. By using add_filter(‘the_content’,’my_custom_filter’)
c. By using wp_filter(‘the_content’,’my_custom_filter’)
d. By using add_action(‘content’,’my_custom_filter’)
54. How can a post ID be retrieved from the permalink?
Answers:
a. Its not possible to retrieve the post ID from a permalink due to its structure.
b. It can be retrieved by using a Regular Expression.
c. wp_get_post_id($permalink)
d. url_to_postid($permalink)
a. Its not possible to retrieve the post ID from a permalink due to its structure.
b. It can be retrieved by using a Regular Expression.
c. wp_get_post_id($permalink)
d. url_to_postid($permalink)
55. Which of the following is the correct way to redirect the default login and registration page URL to a custom login and registration page URL?
Answers:
a. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { return(‘Your custom url’); exit(); } }
b. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_redirect(‘Your custom url’); exit(); } }
c. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { redirect(‘Your custom url’); exit(); } }
d. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_return(‘Your custom url’); exit(); } }
a. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { return(‘Your custom url’); exit(); } }
b. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_redirect(‘Your custom url’); exit(); } }
c. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { redirect(‘Your custom url’); exit(); } }
d. add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_return(‘Your custom url’); exit(); } }
56. How can a WordPress template be integrated inside a codeigniter framework using WordPress functions like wp_header,wp_footer,wp_sidebar?
Answers:
a. Include the file wp-blog-header.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
b. Include the file wp-settings.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
c. Create template inside WordPress theme directory and include the file in codeigniter’s view.php file.
d. It is not possible to integrate wordpress with codeigniter.
a. Include the file wp-blog-header.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
b. Include the file wp-settings.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
c. Create template inside WordPress theme directory and include the file in codeigniter’s view.php file.
d. It is not possible to integrate wordpress with codeigniter.
57. What is the first action you need to take for enabling the WordPress multisite (MS) feature?
Answers:
a. Enable the WordPress multisite feature on admin panel
b. Enable the Network feature
c. Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
a. Enable the WordPress multisite feature on admin panel
b. Enable the Network feature
c. Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
58. Which of the functions below is required to create a new taxonomy?
Answers:
a. add_taxonomy
b. register_taxonomy
c. create_taxonomy
Answers:
a. add_taxonomy
b. register_taxonomy
c. create_taxonomy
59. Which of the following actions cannot be hooked in with add_submenu_page() function?
Answers:
a. admin_submenu
b. admin_menu
c. user_admin_menu
d. network_admin_menu
a. admin_submenu
b. admin_menu
c. user_admin_menu
d. network_admin_menu
60. Which of the following is the correct way to filter the content for a few posts?
Answers:
a. By using apply_filters(filter,postId)
b. This is not possible in wordpress
c. Can create filter for posts in a specific wordpress category
d. Passing arguments into the_content()
a. By using apply_filters(filter,postId)
b. This is not possible in wordpress
c. Can create filter for posts in a specific wordpress category
d. Passing arguments into the_content()
61. What is the function of add_filter in WordPress?
Answers:
a. It registers a filter for a tag.
b. It removes line breaks from the pages list.
c. It is a companion function to apply_filters().
d. All of the above.
a. It registers a filter for a tag.
b. It removes line breaks from the pages list.
c. It is a companion function to apply_filters().
d. All of the above.
62. Which of the following code snippets will create plugins back-end page without showing it as menu item?
Answers:
a. add_submenu_page with parent slug = null
b. add_menu_page with parent slug = null
c. add_submenu_page without parent slug = null
d. add_menu_page without parent slug = null
a. add_submenu_page with parent slug = null
b. add_menu_page with parent slug = null
c. add_submenu_page without parent slug = null
d. add_menu_page without parent slug = null
63. ____________ can manage their own profiles, but can do virtually nothing else in the administration area.
Answers:
a. Contributor
b. Author
c. Editor
d. Subscriber
e. Administrator
a. Contributor
b. Author
c. Editor
d. Subscriber
e. Administrator
64. Are categories and tags available for pages?
Note: Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can’t assign them the same slug.
Answers:
a. Yes
b. No
a. Yes
b. No
65. Which of the following is the correct way to get WordPress Post ID from the Post title?
Answers:
a. $page = get_page_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
b. $page = get_page_by_title( ‘Home’ ); $page_id = $page->ID;
c. $page = get_page_by_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
d. None of the above
a. $page = get_page_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
b. $page = get_page_by_title( ‘Home’ ); $page_id = $page->ID;
c. $page = get_page_by_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
d. None of the above
66. Which of the following will correctly add custom mod rewrite rules to .htaccess from a WordPress plugin?
Answers:
a. $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $POST[“wp_rewrite”]; }}
a. $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $POST[“wp_rewrite”]; }}
b. $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $GLOBALS[“wp_rewrite”]; } }
c. $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $GLOBALS[“wp_rewrite”]; } function mod_rewrite_rules($rules) { return preg_replace(‘#^(RewriteRule \^.*/)\?\$plugin_name .*(http://.*) \[QSA,L\]#mi’, ‘$1 $2 [R=301,L]’, $rules); } }
d. $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $SESSION[“wp_rewrite”]; } }
67. Which of the following is the correct code to get an array of every image uploaded to a particular post?
Answers:
a. $images =& get_children( ‘post_type=attachment&post_mime_type=image&post_parent=10’ );
b. $images = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
c. $images = get_post(7, ARRAY_A);
d. It cannot be done
a. $images =& get_children( ‘post_type=attachment&post_mime_type=image&post_parent=10’ );
b. $images = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
c. $images = get_post(7, ARRAY_A);
d. It cannot be done
68. Which of the following will echo the base URL of a WordPress site?
Answers:
a.
b.
c.
d.
a.
b.
c.
d.
69. Which of the following functions are used when adding CSS and jQuery codes on a WordPress plugin?
Answers:
a. wp_register_style
b. wp_enqueue_style
c. wp_enqueue_script
d. None of these.
a. wp_register_style
b. wp_enqueue_style
c. wp_enqueue_script
d. None of these.
70. In order to display a widget, the user must _________________.
Answers:
a. set the “show property” of the desired widget to “true”
b. drag the desired widget to the side ba
c. add the desired widget to the post
d. change the source code
a. set the “show property” of the desired widget to “true”
b. drag the desired widget to the side ba
c. add the desired widget to the post
d. change the source code
No comments:
Post a Comment