Make WordPress Core

Ticket #34373: 34373.2.diff

File 34373.2.diff, 882 bytes (added by danielbachhuber, 8 years ago)

Don't set is_home when REST_REQUEST

  • src/wp-includes/query.php

    diff --git src/wp-includes/query.php src/wp-includes/query.php
    index 5a6a6eb..a2b2365 100644
    class WP_Query { 
    18111811                if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) )
    18121812                        $this->is_comment_feed = true;
    18131813
    1814                 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 ) )
     1814                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 ) )
    18151815                        $this->is_home = true;
    18161816
    18171817                // Correct is_* for page_on_front and page_for_posts