Determines whether the query is the main query.
Source
public function is_main_query() {
global $wp_the_query;
return $wp_the_query === $this;
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
CARVIEW |
Determines whether the query is the main query.
public function is_main_query() {
global $wp_the_query;
return $wp_the_query === $this;
}
Used by | Description |
---|---|
_resolve_template_for_new_post()wp-includes/block-template.php | Sets the current WP_Query to return auto-draft posts. |
wp_get_loading_attr_default()wp-includes/deprecated.php | Gets the default value to use for a |
WP_Query::parse_query()wp-includes/class-wp-query.php | Parses a query string and sets query type booleans. |
WP_Query::parse_search()wp-includes/class-wp-query.php | Generates SQL for the WHERE clause based on passed search terms. |
is_main_query()wp-includes/query.php | Determines whether the query is the main query. |
Version | Description |
---|---|
3.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.