Answers:
- adding the following line to your wp-config.php file: define(‘WP_POST_REVISIONS’, 3);
- using a plugin
- changing a setting on admin panel
Answers:
- md5()
- wp_generate_password()
- wp_generate_md5()
- password_md5()
Answers:
- my_admin()
- view_admin()
- is_admin()
- root_admin()
Answers:
- add_menu_page();
- add_admin_item();
- add_admin_page();
- add_admin_option();
Answers:
- switch_blog()
- switch_to_blog()
- restore_current_blog()
- restore_to_current_blog()
Answers:
- Use the following code snippet $lastid->$wpdb=$last->get_row;
- 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.
- The following code snippet should be added $last = $wpdb->get_row(“SHOW TABLE STATUS LIKE ‘table_name'”); $lastid = $last->Auto_increment;
- Straight after the $wpdb->insert() insert, the following code should be added: $lastid = $wpdb->insert_id;
Answers:
- Refinery
- Typof
- Symenta
- Rubyalt
Answers:
- register_new_post()
- register_post_status()
- add_new_post_status()
- modify_post_status()
Answers:
- By using function wp_enqueue_script(‘media-upload’)
- By using function wp_add_media( );
- By using function wp_enqueue_script(‘upload’);
- By using function wp_add_script(‘media-upload’);
Answers:
- insert, delete, update, drop and alter
- select, insert, delete, update, create, drop and alter
- insert, delete, update, create, drop and alter
- insert and delete
Answers:
- WP Super Cache
- qTranslate
- BuddyPress
- Hotfix
Answers:
- wp_insert_post()
- wp_insert_page()
- wp_create_post()
- wp_create_page()
Answers:
- get_the_title()
- content_title()
- page_name()
- post_name()
Answers:
- Updating the database.
- Changing the source code.
- Configuring the feature in the config file.
- Configuring the feature in the admin settings.
Answers:
- Contributo
- Autho
- Edito
- Subscribe
- Administrato
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’)
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
Answers:
- MySQL
- Oracle Database
- Microsoft SQL Server
- PostgreSQL
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.
Answers:
- using plug-ins
- adding them to the header.php file
- updating the database
- a and
- and c
Answers:
- <!–?php plugin_basename($file); ?–>
- <!–?php plugin_basename(‘url’); ?–>
- < !–?php bloginfo_plugin(‘url’); ?–>
- < !–?php content_plugin_url( $path ); ?–>
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
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.
Answers:
- 10 levels
- 20 levels
- No limit levels
Answers:
- Yes
- No
Answers:
- sql_real_escape_strong()
- mysql_real_escape()
- mysql_real_escape_string()
- mysql_not_real_delete_string()
Answers:
- Level_0
- Level_10
- Depends on your settings.
- Every role level has the same privilege.
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
Answers:
- <!–?php echo get_post_thumb($page->ID, ‘thumbnail’); ?–>
- <!–?php echo get_featured_image($page->ID, ‘thumbnail’); ?–>
- <!–?php echo get_the_post_thumbnail($page->ID, ‘thumbnail’); ?–>
- <!–?php echo get_post_thumbnail($page->ID, ‘thumbnail’); ?–>
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’); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
Answers:
- directly in the posts
- in the wp-imageresize plug-in
- in the admin settings
- a and
Answers:
- User can not be retrieved through its meta data
- get_user_by_metadata($metaid,$metavalue)
- get_user($args)
- get_users($args)
Answers:
- POST
- GET
- SESSION or COOKIE
- POST or GET
Answers:
- <form enctype=”multipart/form-data” method=”post” action=”<?=bloginfo(“siteurl”);?>/wp-admin/media-upload.php?inline=&upload-page-form=” class=”media-upload-form type-form validate” id=”file-form”>
- <a onclick=”return false;” title=”Upload image” class=”thickbox” id=”add_image” href=”media-upload.php?type=image&TB_iframe=true&width=640&height=105″>Upload Image</a>
- <a href=”media-upload.php?type=image&TB_iframe=true&width=640&height=105″>Upload Image</a>
- <form enctype=”multipart/form-data” method=”post” action=”<?=bloginfo(“bloginfo”);?>/wp-admin/media-upload.php?inline=&upload-page-form=” class=”media-upload-form type-form validate” id=”file-form”>
$firstTag = $tags[0];
Answers:
- $firstTag[‘slug’];
- $firstTag->slug
- $firstTag.slug
$firstTag[0][‘slug’]
Answers:
- document.getElementById(‘content’)
- tinymce.activeEditor.getContent();
- tinymce.element.getContent();
- document.getElement(‘tinymce_content’)
Answers:
- Yes
- No
Answers:
- update the database
- change the admin settings
- change the config files
- use a plug-in
Answers:
- In Hex string
- In Base64 string
- in raw data file
- text file
Answers:
- Enable WordPress MU feature on admin panel
- Enable Network feature
- Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );
Answers:
- 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.
- There is no such thing as Automated Testing in WordPress.
“Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647”
Answers:
- define(E_DEPRECATED, false);
- error_reporting(E_ALL ^ E_DEPRECATED);
- define(E_NOTICE, false);
- error_reporting(WP_DEBUG, true)
Answers:
- using a built-in tool
- using a plugin
- using a widget
- Traffic statistics cannot be collected on a WordPress site.
Answers:
- Contributo
- Autho
- Edito
- Subscribe
- Administrato
Answers:
- 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
Answers:
- Contributor
- Author
- Editor
- Subscriber
- Administrator
Answers:
- 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)
- 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)
- 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) having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)
- 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)
Answers:
- 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
- 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
- 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
- Step 1 – Create the objects of your plugin Step 2 – Adding settings/options to your plugin Step 3 – Finishing the code
<li>example 1
<li>example 2
<li>example 3
<li>example 4
$(document).ready(function(){
$(‘#sortable’).sortable({
update: function(event, ui) {
var newOrder = $(this).sortable(‘toArray’).toString();
$.get(‘saveSortable.php’, {order:newOrder});
}
});
});
Answers:
- Removes positions from data base based on the user input
- Saves sortable positions to data base based on the user input
- Adding new sortable positions from another data base
- Sorting out existing positions without updating the data base with the new user inputs
Answers:
- wp_set_post_categories($postId,$categories)
- wp_set_category($catId,$postId)
- By XML-RPC call to wpc.newPost
- This is not possible
Answers:
- get all comments from one post
- get all posts from one category
- change the content to be displayed
- None of the above: conditional tags are not available in WordPress.
Answers:
- sudo chown -Rf www-data *
- chown -Rf www-data *
- sudo crown -Df www-data *
- Alldo chown -Rf www-data *
Answers:
- By using add_action(‘the_content’,’my_custom_filter’)
- By using add_filter(‘the_content’,’my_custom_filter’)
- By using wp_filter(‘the_content’,’my_custom_filter’)
- By using add_action(‘content’,’my_custom_filter’)
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)
Answers:
- add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { return(‘Your custom url’); exit(); } }
- add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_redirect(‘Your custom url’); exit(); } }
- add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { redirect(‘Your custom url’); exit(); } }
- add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_return(‘Your custom url’); exit(); } }
Answers:
- Include the file wp-blog-header.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
- Include the file wp-settings.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
- Create template inside WordPress theme directory and include the file in codeigniter’s view.php file.
- It is not possible to integrate wordpress with codeigniter.
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 );
Answers:
- add_taxonomy
- register_taxonomy
- create_taxonomy
Answers:
- admin_submenu
- admin_menu
- user_admin_menu
- network_admin_menu
Answers:
- By using apply_filters(filter,postId)
- This is not possible in wordpress
- Can create filter for posts in a specific wordpress category
- Passing arguments into the_content()
Answers:
- It registers a filter for a tag.
- It removes line breaks from the pages list.
- It is a companion function to apply_filters().
- All of the above.
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
Answers:
- Contributor
- Author
- Editor
- Subscriber
- Administrator
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:
- Yes
- No
Answers:
- $page = get_page_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
- $page = get_page_by_title( ‘Home’ ); $page_id = $page->ID;
- $page = get_page_by_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
- None of the above
Answers:
- $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”]; }}
- $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”]; } }
- $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); } }
- $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”]; } }
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
Answers:
- <?php echo get_bloginfo(‘base_url’) ?>
- <?php echo get_bloginfo(‘url’) ?>
- <?php echo get_bloginfo(‘site_url’) ?>
- <?php echo get_website_url() ?>
Answers:
- wp_register_style
- wp_enqueue_style
- wp_enqueue_script
- None of these.
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
Answers:
- my_admin()
- view_admin()
- is_admin()
- root_admin()
Answers:
- By manually adding the class name in Appearance—>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<ul class=\»level-«.$depth.»\»>\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<ul class=\»level-«.$depth.»\»>\n»; } }
Answers:
- Prettify
- SyntaxHighligherText
- XEdit Pad
- Collabedit
Answers:
- page-slug-about.php
- page-about.php
- about.php
Answers:
- Only administrators, editors and authors
- Registered users who knows password
- Anyone who knows a password
Answers:
- Stock Format
- Stock Variable
- Stock Symbol
- Stock Supplier
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
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;}
Answers:
- 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
Answers:
- 3
- 4
- 5
- 6
Answers:
- <?php add_filter(«hook_comment_text’, ‘Markdown’); ?>
- WordPress does not support the Markdown format.
- <?php add_filter(‘comment_text’, ‘Markdown’); ?>
- <?php add_filter(‘comments’, ‘Markdown’); ?>
Answers:
- <?php add_filter(«hook_comment_text’, ‘Markdown’); ?>
- WordPress does not support the Markdown format.
- <?php add_filter(‘comment_text’, ‘Markdown’); ?>
- <?php add_filter(‘comments’, ‘Markdown’); ?>
Answers:
- <? php wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ => false)); ?>
- <? php wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ =0)); ?>
- In functions.php following code should be added:
function page_menu_args( $args ){
$args[‘show_home’] = False;
return $args;
}
add_filter( ‘wp_page_menu_args’, ‘page_menu_args’);
Plus additional snippet code:
wp_nav_menu( array(‘echo’=>true));
} - $(“div.menu > u; li:first-child”).css(“display”,”none”);
Answers:
- 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
Answers:
- <?php $wpdb->query(‘query’); ?>
- <?php $query = new WP_Query( ‘author=2,6,17,38’ ); ?>
- <?php wp_reset_query(); ?>
- <?php $wpdb->query(‘select * from my_plugin_table where foo = «bar»‘); ?>
Answers:
- Yes
- No
Answers:
- do_action (‘wpmu_blog’, $blog_id, $user_id, $domain, $path, $site_id, $meta);
- 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);
Answers:
- Only administrators, editors and authors.
- Registered users who know a password.
- Anyone who knows a password.
- do_action (‘wpmu_new_blog’, $blog_id, $user_id, $domain, $path, $site_id, $meta);
Answers:
- register_globals()
- magc_quotes()
- addslashers()
- get_permalink()
Answers:
- <div class=”highlight”> {your code} </div>
- [color:red] {your code} [/color]
- install syntax highlight plugin
- [sourcecode language=’php’]{your code}[/sourcecode]
Answers:
- Browse the Codex.
- Look at the source code.]
- install syntax highlight plugin
- [sourcecode language=’php’]{your code}[/sourcecode]
Answers:
- wp_custommeta
- wp_options
- wp_terms
- wp_postmeta
Answers:
- get_terms(‘post_tag’, array(‘hide_empty’ => false));
- get_terms(array(‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false));
- get_term();
- wp_terms()
- wp_terms_checklist();
Answers:
- At the time of form submission
- Before the data is saved in the database.
- before the data is being rendered on the webpage
Answers:
- 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 );
Answers:
- current_filter
- current_action_name
- current_hook
Answers:
- <?php the_title( ‘<h1>’, ‘</h1>’ ); ?>
- <h1><?php get_the_title(); ?>
- <?php the_title( ‘<h1>’, ‘</h1>’, ‘display_title’ ); ?>
- <h1>?php the_title(); ?></h1>
Answers:
- $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;
Answers:
- $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;
Answers:
- site_url(‘?’ . $foo . ‘=’ . $bar);
- home_url(‘$’ . $foo . ‘=’ . $bar);
- add_query_arg($foo, $bar, home_url());
Answers:
- 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
Answers:
- 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.
Answers:
- code
- form
- img
- strike
- table
Answers:
- 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’ );
Answers:
- Options
- Meta tables
- Transients
- The REST API
Answers:
- 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.
Answers:
- Yes
- No
Answers:
- $wpdb
- $wp_db
- $db_query
- $wp_query
Answers:
- 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.
Answers:
- Post
- Page
- Links
- Attachment
- Revision
- Comments
- Navigation menu
Answers:
- Page Break
- Page Generator
- WP-PageNavi
- Page-list
Answers:
- System
- Subscriber
- Administrator
- Editor
Answers:
- 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_DAYS’, 0);
Answers:
- aiff
- mp3
- ogg
- flac
- wma
- wav
Answers:
- 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);
Answers:
- Using the has_action(‘my_action’) function.
- Using the did_action(‘my_action’) function.
- Using the current_filter function.
Answers:
- 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’
) );
Answers:
- has_enqueue_script(‘my-script-handle’);
- wp_script_is(‘my-script-handle’, ‘enqueued’);
- is_script_loaded(‘my-script-handle’);
Answers:
- ‘name’
- ‘description’
- homeurl’
- ‘admin email’
Answers:
- $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’);
Answers:
- No
- Yes, with wp_insert_post() function
- Yes, with wp_add_post() function
- Yes, with wp_create_post() function
Answers:
- Action Hook
- Filter Hook
Answers:
- No
- Yes
Answers:
- 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’);
Answers:
- WordPress.com
- WordPress.org
- Open Source WordPress
- WordPress online
Answers:
- In Settings > Media
- In Settings > General
- In Settings > Reading
- In Settings > Writing
Answers:
- post_category
- post_tag
- link_category
- product_tag
- post_format
- category
Answers:
- style.css and functions.php
- style.css and index.php
- index.php and functions.php
- index.php, functions.php and style.css
Answers:
- 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.
Answers:
- 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
Answers:
- 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;
}
Answers:
- Theme Modification API
- Metadata API
- Theme Update API
- Settings API
- Options API
- Theme Customization API
- User API
- Update API
Answers:
- Theme Modification API
- Metadata API
- Theme Update API
- Settings API
- Options API
- Theme Customization API
- User API
- Update API
Answers:
- Username
- Access tokens
- Role
- Cookies
Answers:
- WP_SITEURL
- WP_CONTENT_DIR
- WP_CONTENT_URL
- WP_HOME_URL
Answers:
- _wp
- w_
- wp_
- wp-
Answers:
- setup-example.xml
- wp_config_sample.php
- wp-config-sample.php
- wp-setup-sample.php
Answers:
- function my_network_admin_notice() {
echo ‘<div class=»updated»><p>Network Admin Dashboard Notice!</p></div>’;
}
add_action(‘admin_notices’, ‘my_network_admin_notice’); - function my_admin_notice() {
echo ‘<div class=»updated»><p>Network Admin Dashboard Notice!</p></div>’;
}
add_action(‘network_admin_notice’, ‘my_admin_notice’); - function my_notice() {
echo ‘<div class=»updated»><p>Network Admin Dashboard Notice!</p></div>’;
}
add_action(‘network_admin_notices’, ‘my_notice’);
Answers:
- 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’));
Answers:
- 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
Answers:
- Contact form7
- Akismet
- All in one SEO
- Hello Dolly
Answers:
- wp_update_user
- wp_create_user
- register_new_user
- wp_insert_user
Answers:
- is_visitor_logged_in ( );
- is_user_logged_in ( );
- if_user_logged_in ( );
- is_user_logged ( );
Answers:
- setup.html
- wp-setup.php
- wp-config.php
- wp-install.php
Answers:
- Moderate comments
- Publish posts
- Edit posts
- Edit pages
Answers:
- They all return URLs
- They are all deprecated
- They all point to posts or post lists
- They all echo something
Answers:
- Post
- Page
- Blog
- Archive
- Category
Answers:
- In wp-config.php
- In Dashboard->Settings->Reading
- In Dashboard->Settings->General
- In Dashboard->Appearance
Answers:
- 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);
Answers:
- 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.
1254,9930,10974,”192”,9930,192
Answers:
- 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);
1254,9930,10974,”192”,9930,192
Answers:
- 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);
Answers:
- 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.
1254,9930,10974,”192”,9930,192
Answers:
- _e( ‘Publish something using our <a href=»http://support.wordpress.com/post-by-email/»>Post by Email</a> feature.’ );
- printf( __( ‘Publish something using our <a href=»%s»>Post by Email</a> feature.’), ‘http://support.wordpress.com/post-by-email/’ );
- printf( __( ‘Publish something using our %s feature.’ ), sprintf( ‘<a href=»http://support.wordpress.com/post-by-email/»>%s</a>’, __( ‘Post by Email’ ) ) );
Answers:
- wp_posts
- wp_postmeta
- wp_terms
Answers:
- http://rpc.pingomatic.com
- http://google.com
- http://ping.feedburner.com
- http://www.feedsubmitter.com
Answers:
- Small Size
- Medium Size
- Large Size
- Thumbnail Size
Answers:
- 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.
Answers:
- 1
- 10
- 100
- Unlimited
index.php
front-page.php
home.php
Answers:
- 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
Answers:
- page.php
- style.css
- index.php
- comments.php
- screenshot.png
Answers:
- Notes
- PostgreSQL
- MySQL
- Oracle
Answers:
- draft (Draft)
- pending (Pending Review)
- private (Private)
- publish (Published)
Answers:
- aside
- image
- quote
- status
Answers:
- tool_box
- tiny_mce_before_init
- tiny_mce_plugins
- htmledit_pre
Answers:
- 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.
Answers:
- On the blog list page.
- On the single post page.
- It depends on how your theme is set up.
- On the archive page.
Answers:
- WP_Widget
- WP_Widget_Form_Customize_Control
- WP_Customize_Control
- WP_Customize_Sidebar_Section
Answers:
- 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.
Answers:
- activate_wp_head
- init
- activate_header
- xmirpc_call
Answers:
- for loop
- while loop
- foreach loop
Answers:
- the_field()
- wp_title()
- wp_field()
index.php
category.php
archive.php
category-ID.php
category-slug.php
Answers:
- 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
Answers:
- get_the_title( );
- the_title_attribute( );
- the_title( );
Answers:
- start_lvl( )
- end_lvl( )
- start_li( )
- end_li( )
Answers:
- Gets random post ID.
- Gets random category ID.
- Generates a random post ID for wp_insert_post() function.
- Generates a random number.
Answers:
- Yes, with wp_edit_post( ) function.
- Yes, with wp_update_post( ) function.
- Yes, with wp_change_post( ) function.
- No.
Answers:
- style.css file in the theme folder
- index.php file in the theme folder
- readme.txt file in the theme folder
Answers:
- 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
- single-{post-type}.php, single.php, singular.php, single-{post-type}-{slug}.php, index.php
Answers:
- body_class( )
- get_body_classes( )
- get_theme_support( )
- sanitize_html_class( )
Answers:
- about-us.php
- page-about-us.php
- page-about.php
- about-us-page.php
Answers:
- echo get_the_post_thumbnail($page->ID, ‘thumbnail’);
- echo get_the_featured_image($page->ID, ‘thumbnail’);
- the_post_thumbnail($page->ID, ‘thumbnail’);
- the_featured_image($page->ID, ‘thumbnail’);
Answers:
- get_page_by_path( )
- get_page_url( )
- get_page_link( )
- get_page_uri( )
Answers:
- <?php scanf( __( ‘Howdy, %s’ ), $username ); ?>!
- <?php echo __( ‘Howdy’ ) . ‘, ‘ . $username; ?>!
- <?php printf( __( ‘Howdy, %s!’ ), $username ); ?>
- <?php _e( «Howdy, $username!» ); ?>
- <?php _e( ‘Howdy, %s!’, $username ); ?>
Answers:
- Contributor
- Author
- Editor
- Subscriber
- Administrator
«Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647»
Answers:
- define(E_DEPRECATED, false);
- error_reporting(E_ALL ^ E_DEPRECATED);
- define(E_NOTICE, false);
- error_reporting(WP_DEBUG, true)
- Administrator
Answers:
- post
- page
- attachment
- revision
- nav_menu_item
Answers:
- add_theme_support( ‘thumbnails’ );
- add_support( ‘post-thumbnails’ );
- add_theme_support( ‘post-thumbnails’ );
- theme_support( ‘thumbnails’ );
Answers:
- wp_update_user
- wp_create_user
- register_new_user
- wp_insert_user
Answers:
- Blogger
- Author
- Subscriber
- Contributor
The web site is lovingly serviced and saved as much as date. So it should be, thanks for sharing this with us. autoblog wordpress website
ReplyDeleteSuperbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. GreenGeeks review
ReplyDelete