REST API: Allow queries other than the main query to be is_home
.
Ensure that REST API calls can match the main query of the page. See #34373. Fixes #50213. Props: dlh, TimothyBlynJacobs, boonebgorges, joemcgill, whyisjake. git-svn-id: https://develop.svn.wordpress.org/trunk@48053 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5f49b025aa
commit
78747f9353
@ -965,7 +965,7 @@ class WP_Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed
|
if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed
|
||||||
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST && $this->is_main_query() )
|
||||||
|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {
|
|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {
|
||||||
$this->is_home = true;
|
$this->is_home = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user