WP_Query::query( string|array $query )
Sets up the WordPress query by parsing query string.
Description
See also
WP_Query::parse_query(): for all available arguments.
Parameters
- $query
-
(Required) URL query string or array of query arguments.
Return
(WP_Post[]|int[]) Array of post objects or post IDs.
Source
File: wp-includes/class-wp-query.php
public function query( $query ) {
$this->init();
$this->query = $this->query_vars = wp_parse_args( $query );
return $this->get_posts();
}
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |