181 Test Questions: 1. Which of the following will hash a string/password to its md5 equivalent? Answers:
md5()
wp_generate_password()
wp_generate_md5()
password_md5()
2. Which conditional tag checks if the dashboard or the administration panel is attempting to be displayed by returning «true’ «true’ (if (if the URL being accessed is in the admin section) or «false» (for a front-end page). Answers:
my_admin()
view_admin()
is_admin()
root_admin()
3. How can the class name of a sub-menu be changed in the wp_nav_menu? Answers:
By manually adding the class name in Appearance — Appearance — >Menus >Menus
WordPress does not support the ability to change the class name of a sub-menu in the wp_nav_menu.
By adding the following code in functions.php: class UL_Class_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(«\t», $depth); $output .= «\n$indent
\n»; } }
By adding the following code in header.php: class UL_Class_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(«\t», $depth); $output .= «\n$indent\n»; } }
4. Which of the following functions are used to add administration menu item in WordPress ? Answers:
add_menu_page(); add_admin_item()
add_admin_page();
add_admin_option();
5. Which of the following WordPress Multisite functions allows for getting content from one blog and display it on another? Answers:
switch_blog()
switch_to_blog()
restore_current_blog()
restore_to_current_blog()
6. Which of the following will correctly load localized (translated) (translated) text for a WordPress plugin? Answers: •
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
•
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
•
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir);
•
function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); ‘/lang’); custom_theme_setup(); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
7. User Level 10 converts to _________? Answers: • Contributor • Author • Editor • Subscriber • Administrat Administrator or
8. How can a post ID be retrieved from the permalink?
add_admin_page();
add_admin_option();
5. Which of the following WordPress Multisite functions allows for getting content from one blog and display it on another? Answers:
switch_blog()
switch_to_blog()
restore_current_blog()
restore_to_current_blog()
6. Which of the following will correctly load localized (translated) (translated) text for a WordPress plugin? Answers: •
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
•
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
•
function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir);
•
function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); ‘/lang’); custom_theme_setup(); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
7. User Level 10 converts to _________? Answers: • Contributor • Author • Editor • Subscriber • Administrat Administrator or
8. How can a post ID be retrieved from the permalink?
Answers: • Its not possible to retrieve the post ID from a permalink due to its structure. • It can be retrieved by using a Regular Expression. • wp_get_post_id($permalink) • url_to_postid($permalink)
9. Which of the following code snippets will create plugins back-end page without showing it as menu item? Answers: • add_submenu_page with parent slug = null • add_menu_page with parent slug = null • add_submenu_page without parent slug = null • add_menu_page without parent slug = null
10. Can the contents of the wp-content folder be moved or renamed without changing any settings? Answers: • Yes • No
11. Which of the following codes will return the current plugin directory in WordPress? Answers: • • • •
12. Which of the following is the correct sequence of steps to adapt a WordPress WordPre ss plugin to a multisite? Answers: • 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 • 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 • 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
• 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
13. Which of the following is the correct way to get WordPress Post ID from the Post title? Answers: • $page = get_page_title( ‘About’ ‘About’ ); ); wp_pages( ‘exclude=’ ‘exclude=’ . . $page->ID ); • $page = get_page_by_title( ‘Home’ ‘Home’ ); ); $page_id = $page->ID; • $page = get_page_by_title( ‘About’ ‘About’ ); ); wp_pages( ‘exclude=’ ‘exclude=’ . . $page->ID ); • None of the above
14. What is the first action you need to take for enabling the WordPress multisite (MS) feature? Answers: • Enable the WordPress multisite feature on admin panel • Enable the Network feature • Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
15. Meta tags can be added to WordPress pages by ________________. Answers: • using plug-ins • adding them to the header.php file • updating the database • a and b • b and c
16. WordPress’s WordPress’s requirements requirements are modest. At minimum, which of the following standards should your server support for WordPress 3.1? Answers: • PHP version 4.4.9 or greater, MySQL version 4.0 or greater • PHP version 4.3 or greater, MySQL version 4.1.2 or greater • PHP version 4.4.9 or greater, MySQL version 5.1 or greater • PHP version 4.3 or greater, MySQL version 5.1 or greater
17. Which of the following will give the option to add inline Ajax for comment posting? Answers:
• Enabling Ajax in the wp-config.php file • Activating Ajax from the admin settings of WordPress • Using the Ajax Comment Posting plugin • WordPress doesn’t support inline Ajax.
18. What is the limitation to the depth of your categories? Answers: • 10 levels • 20 levels • No limit levels
19. Which of the following code snippets best protects a system from SQL injections? Answers: • sql_real_escape_strong() • mysql_real_escape() • mysql_real_escape_string() • mysql_not_real_delete_string()
20. Which of the following role levels has the highest privilege? Answers: • Level_0 • Level_10 • Depends on your settings. • Every role level has the same privilege.
21. How can the Home link be disable from the WordPress top nav? Answers: • Using Jquery to hide it • 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’ ); • wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ => false)) • Can not disable the default Home link from wordpress top nav
22. Which of the following functions can be used to create a WordPress page? Answers:
• wp_insert_post() • wp_insert_page() • wp_create_post() • wp_create_page()
23. Which function is used to display the name of current page in wordpress? Answers: • get_the_title() • content_title() • page_name() • post_name()
24. Which of the following methods can be used to make permalinks SEO friendly? Answers: • Updating the database. • Changing the source code. • Configuring the feature in the config file. • Configuring the feature in the admin settings.
25. Which of the following is the correct way to add custom excerpts length identifiers in WordPress? Answers: • By adding excerpt_length filter in function.php • Can’t declare custom excerpts in wordpress • Custom exceprts are already available in wordpress • Using the_excerpt(‘long’); or the_excerpt(‘short’)
26. On which of the following databases can WordPress be installed by default? Answers: • MySQL • Oracle Database • Microsoft SQL Server • PostgreSQL
27. Which of the following actions must be performed to import data fromwordpress.com? Answers: • Enter the full access to wordpress.com into the data import form so that it can automatically connect and directly retrieve content. • Import from wordpress.com’s RSS. • Login to wordpress.com, then the export data using the export tool, then import an exported xml file to the site.
28. Which of the following is the correct code to get an array of every image uploaded to a particular post? Answers: • $images =& get_children( ‘post_type=attachment&post_mime_type=image&post_parent=10’ ); • $images = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); • $images = get_post(7, ARRAY_A); • It cannot be done
29. Which of the following will echo the base URL of a WordPress site? Answers: • • • •
30. Which of the following functions are used when adding CSS and jQuery codes on a WordPress plugin? Answers: • wp_register_style • wp_enqueue_style • wp_enqueue_script • None of these.
31. In order to display a widget, the user must _________________. Answers: • set the «show property» of the desired widget to «true» • drag the desired widget to the side ba
• add the desired widget to the post • change the source code
32. Which of the following is a Online Code Coloring Service? Answers: • Prettify • SyntaxHighligherText • Edit Pad • Collabedit
33. What is the name of theme file for a page with slug ‘about’? Answers: • page-slug-about.php • page-about.php • about.php
34. Who of the following persons can read a post locked by password? Answers: • Only administrators, editors and authors • Registered users who knows password • Anyone who knows a password
35. In this stock quote api for wordpress of yahoohttp://download.finance.yahoo.com/d/quotes.csv?s=GOOG&f=ll , what does ‘ s’ stand for? Answers: • Stock Format • Stock Variable • Stock Symbol • Stock Supplier
36. Which of the following is a quick way to move a WordPress website from one server to another? Answers: • Using migration plugin • Copying wordpress files and database from source to destination server • Using XML export through wp-admin interface • Install new wordpress and copy theme and plugin directory
37. Which of the following will remove anchors from all nodes/levels except the 4th level nodes of a WordPress category? Parent node (1st level) — >Child node (2nd level) — ->3rd level node —— >4th level node Answers: • .cat-item a, .cat-item .cat-item a.hover {cursor: default;} .cat-item .cat-item a.hover {cursor: pointer;} • .cat-item a, .cat-item .cat-item a {cursor: default;} .cat-item .cat-item a {cursor: pointer;} • .cat-item a, .cat-item .cat-item .cat-item .cat-item a {cursor: default;} .cat-item .cat-item .cat-item a {cursor: pointer;} • .cat-item a, .cat-item .cat-item a:hover {cursor: pointer;} .cat-item .cat-item a:hover {cursor: default;}
38. Image size limits can be set _______________. Answers: • directly in the posts • in the wp-imageresize plug-in • in the admin settings • a and
39. How can a user be found through its meta data? Answers: • User can not be retrieved through its meta data • get_user_by_metadata($metaid,$metavalue) • get_user($args) • get_users($args)
40. 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: • POST • GET • SESSION or COOKIE • POST or GET
41. Which of the following will call the WordPress media uploader form element? Answers: •