WP_Query::query() – Sets up the WordPress query by parsing query string.

You appear to be a bot. Output may be restricted

Description

Sets up the WordPress query by parsing query string.

Usage

$WP_Post[]|int[] = WP_Query::query( $query );

Parameters

$query
( string|array ) required – URL query string or array of query arguments.

Returns

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

Source

File name: wordpress/wp-includes/class-wp-query.php
Lines:

1 to 6 of 6
  public function query( $query ) {
    $this->WP_Query::init();
    $this->WP_Query::query      = wp_parse_args( $query );
    $this->query_vars = $this->WP_Query::query;
    return $this->WP_Query::get_posts();
  }
 

 View on GitHub View on Trac