is_main_query(). fixes #18677.
git-svn-id: https://develop.svn.wordpress.org/trunk@18699 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
73744eb96c
commit
68c1b54796
@ -715,6 +715,18 @@ function is_404() {
|
|||||||
return $wp_query->is_404();
|
return $wp_query->is_404();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the query the main query?
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function is_main_query() {
|
||||||
|
global $wp_query;
|
||||||
|
return $wp_query->is_main_query();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The Loop. Post loop control.
|
* The Loop. Post loop control.
|
||||||
*/
|
*/
|
||||||
@ -3467,6 +3479,18 @@ class WP_Query {
|
|||||||
function is_404() {
|
function is_404() {
|
||||||
return (bool) $this->is_404;
|
return (bool) $this->is_404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the query the main query?
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function is_main_query() {
|
||||||
|
global $wp_the_query;
|
||||||
|
return $wp_the_query === $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user