rest_get_queried_resource_route()wp-includes/rest-api.php |
Gets the REST route for the currently queried object.
|
WP_Widget_Custom_HTML::widget()wp-includes/widgets/class-wp-widget-custom-html.php |
Outputs the content for the current Custom HTML widget instance.
|
get_embed_template()wp-includes/template.php |
Retrieves an embed template path in the current or parent template.
|
wp_get_document_title()wp-includes/general-template.php |
Returns document title for the current page.
|
get_the_archive_title()wp-includes/general-template.php |
Retrieves the archive title based on the queried object.
|
term_description()wp-includes/category-template.php |
Retrieves term description.
|
wp_list_categories()wp-includes/category-template.php |
Displays or retrieves the HTML list of categories.
|
feed_links_extra()wp-includes/general-template.php |
Displays the links to the extra feeds such as category feeds.
|
single_post_title()wp-includes/general-template.php |
Displays or retrieves page title for post.
|
single_term_title()wp-includes/general-template.php |
Displays or retrieves page title for taxonomy term archive.
|
wp_title()wp-includes/general-template.php |
Displays or retrieves page title for all areas of blog.
|
WP::handle_404()wp-includes/class-wp.php |
Set the Headers for 404, if nothing is found for requested URL.
|
WP_Widget_Text::widget()wp-includes/widgets/class-wp-widget-text.php |
Outputs the content for the current Text widget instance.
|
edit_term_link()wp-includes/link-template.php |
Displays or retrieves the edit term link with formatting.
|
get_single_template()wp-includes/template.php |
Retrieves path of single template in current or parent template. Applies to single Posts, single Attachments, and single custom post types.
|
get_attachment_template()wp-includes/template.php |
Retrieves path of attachment template in current or parent template.
|
get_author_template()wp-includes/template.php |
Retrieves path of author template in current or parent template.
|
get_category_template()wp-includes/template.php |
Retrieves path of category template in current or parent template.
|
get_tag_template()wp-includes/template.php |
Retrieves path of tag template in current or parent template.
|
get_taxonomy_template()wp-includes/template.php |
Retrieves path of custom taxonomy term template in current or parent template.
|
get_page_template()wp-includes/template.php |
Retrieves path of page template in current or parent template.
|
wp_list_pages()wp-includes/post-template.php |
Retrieves or displays a list of pages (or hierarchical post type items) in list (li) format.
|
Skip to note 2 content
Michael Dance
The “currently-queried object” means the object that is the subject of the webpage:
– On a category archive, tag archive, or other taxonomy archive page, it will return the
WP_Termobject of the current category, tag, or other term.– If you have set a posts page where your basic posts are displayed,
get_queried_object()will return theWP_Postobject of that page.– On post type archive pages, it will return the
WP_Post_Typeobject of the given post type.– On an author archive page, it will return the
WP_Userobject of that author.– On any singular page (a single post, a single page, or a post in a custom post type), it will return the
WP_Postobject of that post or page.Be careful not to use
get_queried_object()andget_post()orglobal $postinterchangeably. On a singular post, those will all return the same thing. But, for example, if you have a page called “Blog” that displays your posts,get_queried_object()will return the “Blog” page whereasget_post()will return the current post in the loop.