WordPress Test
____________
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.
Subscribe
e.
Administrator
Which
of the following functions are used to add administration menu item in
WordPress ?
a.
add_menu_page();
b.
add_admin_item();
c.
add_admin_page();
d.
add_admin_option();
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).
a.
my_admin()
b.
view_admin()
c.
is_admin()
d.
root_admin()
Which
of the following is the correct sequence of steps to adapt a WordPress plugin
to a multisite?
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
Which
of the following is the correct code to get an array of every image uploaded to
a particular post?
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);
Which
of the following will correctly load localized (translated) text for a
WordPress plugin?
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');
Which
of the following code snippets can be used to create custom POST status in
wordpress 3.0 +?
a.
register_new_post()
b.
register_post_status()
c.
add_new_post_status()
d.
modify_post_status()
How
can a custom content filter be added?
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')
What
is the BEST way to get last inserted row ID from Wordpress database ?
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;
How
can a post ID be retrieved from the 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)
Which
of the following functions can be used to create a WordPress page?
a.
wp_insert_post()
b.
wp_insert_page()
c.
wp_create_post()
d.
wp_create_page()
Which
of the following code snippets best protects a system from SQL injections?
a.
sql_real_escape_strong()
b.
mysql_real_escape()
c.
mysql_real_escape_string()
d.
mysql_not_real_delete_string()
Which
of the following is an example of a WordPress plugin that provides multilingual
capabilities?
a. WP
Super Cache
b.
qTranslate
c.
BuddyPress
d.
Hotfix
On
which of the following databases can WordPress be installed by default?
a.
MySQL
b.
Oracle Database
c.
Microsoft SQL Server
d.
PostgreSQL
____________
can manage their own profiles, but can do virtually nothing else in the
administration area.
a.
Contributor
b.
Author
c.
Editor
d.
Subscriber
e.
Administrator
Which
of the following WordPress Multisite functions allows for getting content from
one blog and display it on another?
a.
switch_blog()
b.
switch_to_blog()
c.
restore_current_blog()
d.
restore_to_current_blog()
Which
of the following is the correct way to filter the content for a few posts?
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()
Which
of the following codes will return the current plugin directory in WordPress?
a.
<?php plugin_basename($file); ?>
b.
<?php plugin_basename('url'); ?>
c.
<?php bloginfo_plugin('url'); ?>
d.
<?php content_plugin_url( $path ); ?>
Which
of the functions below is required to create a new taxonomy?
a.
add_taxonomy
b.
register_taxonomy
c.
create_taxonomy
Which
of the following is the correct way to print the slug property of $firstTag
object in this code snippet?
$tags
= wp_get_post_tags($post->ID);
$firstTag
= $tags[0];
a.
$firstTag[‘slug’];
b.
$firstTag->slug
c.
$firstTag.slug
d.
$firstTag[0][‘slug’]
A
possible way to allow the display of several authors' names on one post is to
__________
a.
update the database
b.
change the admin settings
c.
change the config files
d.
use a plug-in
What
is the output of the following code?
function
addTerm($id, $tax, $term) {
$term_id = is_term($term);
$term_id = intval($term_id);
if (!$term_id) {
$term_id = wp_insert_term($term, $tax);
$term_id = $term_id['term_id'];
$term_id = intval($term_id);
}
// get the list of terms already on this
object:
$terms = wp_get_object_terms($id, $tax)
$terms[] = $term_id;
$result =
wp_set_object_terms($id, $terms, $tax, FALSE);
return $result;
}
a.
Wordpress API accepts a single ID of an
existing tag
b.
Wordpress API add and remove tags to a post using the post ID
c.
Wordpress API automatically gets the post_id injected as the first argument
d.
Wordpress API wp_set_object_terms()
expects the second parameter to be an array
Which
of the following is the correct way to retrieve a featured image from a post?
a.
<?php echo get_post_thumb($page->ID, 'thumbnail'); ?>
b.
<?php echo get_featured_image($page->ID, 'thumbnail'); ?>
c.
<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
d. <?php
echo get_post_thumbnail($page->ID, 'thumbnail'); ?>
Which
of the following methods can be used to make permalinks SEO friendly?
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.
Can
the contents of the wp-content folder be moved or renamed without changing any
settings?
a.
Yes
b. No
Which
of the following commands can change the ownership of WordPress directory to
www-data (for
Apache)?
a.
sudo chown -Rf www-data *
b.
chown -Rf www-data *
c. sudo
crown -Df www-data *
d.
Alldo chown -Rf www-data *
____________
can write their own posts but may not publish or delete them. Their HTML is
limited to the set of allowed tags and they cannot upload media files.
a.
Contributor
b.
Author
c.
Editor
d.
Subscribe
e.
Administrator
What
is the first action you need to take for enabling the WordPress multisite (MS)
feature?
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 );
Which
of the following is the correct way to include the content of one page to
another?
a.
wp_get_page($page) to retrieve the content
b. By
using get_page_by_path($path) function to retrieve page content
c.
wp_show_page($page)
d.
show_post($post)
What
is the function of add_filter in WordPress?
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.
Meta
tags can be added to WordPress pages by _______________.
a.
using plug-ins
b.
adding them to the header.php file
c.
updating the database
d.
using plug-ins and adding them to the header.php file
e. adding
them to the header.php file and updating the database
Which
of the following code snippets will create plugins back-end page without
showing it as menu item?
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
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?
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();
}
}
Which
of the following is the correct way to get WordPress Post ID from the Post
title?
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
What
is the limitation to the depth of your categories?
a. 10
levels
b. 20
levels
c.
No limit levels
One
possible way to collect realtime statistics about traffic on a WordPress site
is:
a.
using a built-in tool
b.
using a plugin
c.
using a widget
d.
Traffic statistics cannot be collected on a WordPress site.
Image
size limits can be set _____________.
a.
directly in the posts
b. in
the wp-imageresize plug-in
c.
in the admin settings
d. both
directly in the posts and in the wp-imageresize plug-in
Which
of the following is a quick way to move a Wordpress website from one server to
another?
a.
Using migration plugin
b.
Copying wordpress files and database from source to destination server
c.
Using XML export through wp-admin interface
d.
Install new wordpress and copy theme and plugin directory
Which
of the following role levels has the highest privilege?
a.
Level_0
b.
Level_10
c.
Depends on your settings.
d.
Every role level has the same privilege.
In
a WordPress multsite, how can a new blog site be added from the Network Admin
panel?
a.
add_action( $tag, $function_to_add, $priority,
$accepted_args );
b.
define('WP_ALLOW_MULTISITE', true);
c.
do_action( 'wpmu_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
d.
do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta
);