WordPress at Your Fingertips
function is not described

WP_Query::query() public WP 1.5.0

Sets up the WordPress query by parsing query string.

{} It's a method of the class: WP_Query{}

No Hooks.


WP_Post[]|Int[]. Array of post objects or post IDs.


global $wp_query;
$wp_query->query( $query );
$query(string|array) (required)
URL query string or array of query arguments.


Code of WP_Query::query() WP 5.8.3

public function query( $query ) {
	$this->query      = wp_parse_args( $query );
	$this->query_vars = $this->query;
	return $this->get_posts();