In WP_Query
, set is_home
to false
during REST requests.
Props danielbachhuber. Fixes #34373. git-svn-id: https://develop.svn.wordpress.org/trunk@35690 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6a2eaf6448
commit
1d3749ea87
@ -1811,7 +1811,7 @@ class WP_Query {
|
||||
if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) )
|
||||
$this->is_comment_feed = true;
|
||||
|
||||
if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
|
||||
if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
|
||||
$this->is_home = true;
|
||||
|
||||
// Correct is_* for page_on_front and page_for_posts
|
||||
|
Loading…
Reference in New Issue
Block a user