Wordpress Interview Questions
Wordpress Interview Questions

WordPress Interview Questions

1.) Debugging Mode In WordPress: define(‘WP_DEBUG’, true); In wp_config.php File
2.) In worpdpress function provide post: get_posts, wp_get_recent_posts, query_posts
3.) In wordpress make simple php file using as wordpress file need to add: require_once(‘../blog/wp-load.php’);
4.) get_permalink( int|WP_Post $post, bool $leavename=false): Retrieves the full permalink for the current post or post ID.
5.) wpdb::get_results( string $query = null, string $output=OBJECT) : Retrieves an entire SQL result set from the database (i.e., many rows).
6.) wpdb::get_row( string|null $query = null, string $output = OBJECT, int $y ): Retrieves one row from the database.
7.) get_categories( string|array $args=”) Retrieves a list of category objects.
8.) is_user_logged_in(): Determines whether the current visitor is a logged in user.
9.) wp_get_current_user() Retrieve the current user object.
10.) get_current_user_id() Get the current user’s ID
11.) get_template_directory_uri() Retrieves template directory URI for current theme.
12.) get_template_part( string $slug, string $name = null, array $args = array()) Loads a template part into a template.
Example: To use this function with subfolders in your theme directory, simply prepend the folder name before the slug. For example, if you have a folder called “partials” in your theme directory and a template part called “content-page.php” in that sub-folder, you would use get_template_part() like this:
get_template_part( ‘partials/content’, ‘page’ );
13.) REST API Developer Endpoint Reference:
i) Posts ——————————————— /wp/v2/posts
ii) Post Revisions ————————————– /wp/v2/posts//revisions
iii) Categories ————————————– /wp/v2/categories
iv) Tags ————————————– /wp/v2/tags
v) Pages ————————————– /wp/v2/pages
vi) Page Revisions ————————————– /wp/v2/pages//revisions
vii) Comments ————————————– /wp/v2/comments
viii) Taxonomies ————————————– /wp/v2/taxonomies
xi) Media ————————————– /wp/v2/media
xii) Users ————————————– /wp/v2/users
xiii) Post Types ————————————– /wp/v2/types
xiv) Post Statuses ————————————– /wp/v2/statuses
xv) Settings ————————————– /wp/v2/settings
xvi) Themes ————————————– /wp/v2/themes
xvii) Search ————————————– /wp/v2/search
xviii) Plugins ————————————– /wp/v2/plugins
14.) In wordpress set function pirority add_action( string $hook_name, callable $callback, int $priority = 10, int $accepted_args = 1 );
15.)WordPress has got you covered with the function – _plugin_active(). You can simply pass the in the plugin basename and WordPress will do the work to see if it is active or not. Take a look at the following code snippet –
16) There are several ways in which you can improve the performance of your WordPress site. Take a look here – Choose a good host, Keep the WordPress core, along with the theme and plugins up to date, Optimize images for better speed, Optimize background process for improved efficiency, Use a caching plugin, Use CDN (Content Delivery Network), Use the latest PHP version, Take out plugins that you don’t use, Optimize the database, Use third-party source for video hosting

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *