Make WordPress Core

Changeset 28667


Ignore:
Timestamp:
06/04/2014 11:42:09 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Avoid a PHP notice when using WP_Query::get_queried_object() in pre_get_posts action.

props wpsmith.
fixes #28412.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r28666 r28667  
    37243724            $this->queried_object = get_post( $page_for_posts );
    37253725            $this->queried_object_id = (int) $this->queried_object->ID;
    3726         } elseif ( $this->is_singular && !is_null($this->post) ) {
     3726        } elseif ( $this->is_singular && ! empty( $this->post ) ) {
    37273727            $this->queried_object = $this->post;
    37283728            $this->queried_object_id = (int) $this->post->ID;
Note: See TracChangeset for help on using the changeset viewer.