WP_Query::__construct( string|array $query = '' )
Constructor.
Description #Description
Sets up the WordPress query, if parameter is not empty.
Parameters #Parameters
- $query
-
(string|array) (Optional) URL query string or array of vars.
Default value: ''
Source #Source
File: wp-includes/class-wp-query.php
public function __construct( $query = '' ) { if ( ! empty( $query ) ) { $this->query( $query ); } }
Expand full source code Collapse full source code View on Trac
Changelog #Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
Related #Related
Uses #Uses
Uses | Description |
---|---|
wp-includes/class-wp-query.php: WP_Query::query() |
Sets up the WordPress query by parsing query string. |
Used By #Used By
Used By | Description |
---|---|
wp-includes/rest-api/search/class-wp-rest-post-search-handler.php: WP_REST_Post_Search_Handler::search_items() |
Searches the object type content for a given search request. |
wp-includes/user.php: wp_create_user_request() |
Create and log a user request to perform a specific action. |
wp-includes/media.php: wp_media_personal_data_exporter() |
Finds and exports attachments associated with an email address. |
wp-admin/includes/class-wp-privacy-requests-table.php: WP_Privacy_Requests_Table::prepare_items() |
Prepare items to output. |
wp-admin/includes/privacy-tools.php: _wp_personal_data_cleanup_requests() |
Cleans up failed and expired requests before displaying the list table. |
wp-includes/class-wp-embed.php: WP_Embed::find_oembed_post_id() |
Find the oEmbed cache post ID for a given cache key. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::import_theme_starter_content() |
Import theme starter content into the customized state. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::find_changeset_post_id() |
Find the changeset post ID for a given changeset UUID. |
wp-includes/theme.php: wp_get_custom_css_post() |
Fetch the |
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php: WP_REST_Revisions_Controller::get_items() |
Gets a collection of revisions. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::get_items() |
Retrieves a collection of posts. |
wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::search_available_items_query() |
Performs post queries for available-item searching. |
wp-admin/includes/dashboard.php: wp_dashboard_recent_posts() |
Generates Publishing Soon and Recently Published sections. |
wp-admin/includes/ajax-actions.php: wp_ajax_query_attachments() |
Ajax handler for querying attachments. |
wp-admin/includes/nav-menu.php: _wp_ajax_menu_quick_search() |
Prints the appropriate response to a menu quick search. |
wp-admin/includes/nav-menu.php: wp_nav_menu_item_post_type_meta_box() |
Displays a meta box for a post type menu item. |
wp-includes/query.php: query_posts() |
Sets up The Loop with query parameters. |
wp-includes/widgets/class-wp-widget-recent-posts.php: WP_Widget_Recent_Posts::widget() |
Outputs the content for the current Recent Posts widget instance. |
wp-includes/post.php: get_posts() |
Retrieves an array of the latest posts, or posts matching the given criteria. |
wp-includes/rewrite.php: url_to_postid() |
Examine a URL and try to determine the post ID it represents. |
wp-includes/nav-menu.php: wp_get_associated_nav_menu_items() |
Get the menu items associated with a particular object. |
wp-includes/class-wp-editor.php: _WP_Editors::wp_link_query() |
Performs post queries for internal linking. |