Constructor.
Description
Sets up the WordPress query, if parameter is not empty.
See also
- WP_Query::parse_query(): for all available arguments.
Parameters
$query
string|arrayoptional- URL query string or array of vars.
Default:
''
Source
public function __construct( $query = '' ) {
if ( ! empty( $query ) ) {
$this->query( $query );
}
}
Related
Uses | Description |
---|---|
WP_Query::query()wp-includes/class-wp-query.php | Sets up the WordPress query by parsing query string. |
Used by | Description |
---|---|
WP_REST_Font_Faces_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php | Creates a font face for the parent font family. |
WP_REST_Font_Families_Controller::get_font_face_ids()wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php | Get the child font face post IDs. |
WP_REST_Font_Families_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php | Creates a single font family. |
WP_Navigation_Fallback::get_most_recently_published_navigation()wp-includes/class-wp-navigation-fallback.php | Finds the most recently published |
WP_REST_Global_Styles_Revisions_Controller::get_items()wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php | Returns paginated revisions of the given global styles config custom post type. |
_wp_build_title_and_description_for_single_post_type_block_template()wp-includes/block-template-utils.php | Builds the title and description of a post-specific template based on the underlying referenced post. |
wp_get_latest_revision_id_and_total_count()wp-includes/revision.php | Returns the latest revision ID and count of revisions for a post. |
WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles()wp-includes/class-wp-theme-json-resolver.php | Returns the custom post type that contains the user’s origin config for the active theme or an empty array if none are found. |
wp_filter_wp_template_unique_post_slug()wp-includes/theme-templates.php | Generates a unique slug for templates. |
get_block_templates()wp-includes/block-template-utils.php | Retrieves a list of unified template objects based on a query. |
get_block_template()wp-includes/block-template-utils.php | Retrieves a single unified template object using its id. |
WP_Sitemaps_Posts::get_url_list()wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Gets a URL list for a post type sitemap. |
WP_Sitemaps_Posts::get_max_num_pages()wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Gets the max number of pages available for the object type. |
WP_REST_Post_Search_Handler::search_items()wp-includes/rest-api/search/class-wp-rest-post-search-handler.php | Searches posts for a given search request. |
wp_create_user_request()wp-includes/user.php | Creates and logs a user request to perform a specific action. |
WP_Privacy_Requests_Table::prepare_items()wp-admin/includes/class-wp-privacy-requests-table.php | Prepares items to output. |
_wp_personal_data_cleanup_requests()wp-admin/includes/privacy-tools.php | Cleans up failed and expired requests before displaying the list table. |
WP_Embed::find_oembed_post_id()wp-includes/class-wp-embed.php | Finds the oEmbed cache post ID for a given cache key. |
WP_Customize_Manager::import_theme_starter_content()wp-includes/class-wp-customize-manager.php | Imports theme starter content into the customized state. |
WP_Customize_Manager::find_changeset_post_id()wp-includes/class-wp-customize-manager.php | Finds the changeset post ID for a given changeset UUID. |
wp_get_custom_css_post()wp-includes/theme.php | Fetches the |
WP_REST_Revisions_Controller::get_items()wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
WP_REST_Posts_Controller::get_items()wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves a collection of posts. |
WP_Customize_Nav_Menus::search_available_items_query()wp-includes/class-wp-customize-nav-menus.php | Performs post queries for available-item searching. |
wp_dashboard_recent_posts()wp-admin/includes/dashboard.php | Generates Publishing Soon and Recently Published sections. |
wp_ajax_query_attachments()wp-admin/includes/ajax-actions.php | Handles querying attachments via AJAX. |
_wp_ajax_menu_quick_search()wp-admin/includes/nav-menu.php | Prints the appropriate response to a menu quick search. |
wp_nav_menu_item_post_type_meta_box()wp-admin/includes/nav-menu.php | Displays a meta box for a post type menu item. |
query_posts()wp-includes/query.php | Sets up The Loop with query parameters. |
WP_Widget_Recent_Posts::widget()wp-includes/widgets/class-wp-widget-recent-posts.php | Outputs the content for the current Recent Posts widget instance. |
get_pages()wp-includes/post.php | Retrieves an array of pages (or hierarchical post type items). |
get_posts()wp-includes/post.php | Retrieves an array of the latest posts, or posts matching the given criteria. |
url_to_postid()wp-includes/rewrite.php | Examines a URL and try to determine the post ID it represents. |
wp_get_associated_nav_menu_items()wp-includes/nav-menu.php | Returns the menu items associated with a particular object. |
_WP_Editors::wp_link_query()wp-includes/class-wp-editor.php | Performs post queries for internal linking. |
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.