WP_Query::query( string|array $query ): WP_Post[]|int[]

Sets up the WordPress query by parsing query string.


Description

Top ↑

See also


Top ↑

Parameters

$query string|array Required
URL query string or array of query arguments.

Top ↑

Return

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


Top ↑

Source

File: wp-includes/class-wp-query.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.