On this page
wp( string|array $query_vars = '' )
Sets up the WordPress query.
Parameters
$query_varsstring|array Optional-
Default WP_Query arguments.
Default:
''
Source
File: wp-includes/functions.php. View all references
function wp( $query_vars = '' ) {
global $wp, $wp_query, $wp_the_query;
$wp->main( $query_vars );
if ( ! isset( $wp_the_query ) ) {
$wp_the_query = $wp_query;
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP::main() wp-includes/class-wp.php | Sets up all of the variables required by the WordPress environment. |
Used By
| Used By | Description |
|---|---|
| wp_edit_posts_query() wp-admin/includes/post.php | Runs the query to fetch the posts for listing on the edit posts page. |
| wp_edit_attachments_query() wp-admin/includes/post.php | Executes a query for attachments. An array of WP_Query arguments can be passed in, which will override the arguments set by this function. |
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp