WP_Query::is_main_query() – Is the query the main query?

You appear to be a bot. Output may be restricted

Description

Is the query the main query?

Usage

$bool = WP_Query::is_main_query();

Parameters

Returns

bool Whether the query is the main query.

Source

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

1 to 4 of 4
  public function is_main_query() {
    global $wp_the_query;
    return $wp_the_query === $this;
  }
 

 View on GitHub View on Trac