Make WordPress Core

Changeset 16543


Ignore:
Timestamp:
11/23/2010 12:47:45 AM (14 years ago)
Author:
scribu
Message:

Minor cleanup in queried object setting logic. See #14590

File:
1 edited

Legend:

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

    r16542 r16543  
    26802680            $this->queried_object = & get_page( $page_for_posts );
    26812681            $this->queried_object_id = (int) $this->queried_object->ID;
    2682         } elseif ( $this->is_single && !is_null($this->post) ) {
    2683             $this->queried_object = $this->post;
    2684             $this->queried_object_id = (int) $this->post->ID;
    2685         } elseif ( $this->is_page && !is_null($this->post) ) {
     2682        } elseif ( $this->is_singular && !is_null($this->post) ) {
    26862683            $this->queried_object = $this->post;
    26872684            $this->queried_object_id = (int) $this->post->ID;
    26882685        } elseif ( $this->is_author ) {
    2689             $author_id = (int) $this->get('author');
    2690             $author = get_userdata($author_id);
    2691             $this->queried_object = $author;
    2692             $this->queried_object_id = $author_id;
    2693         }
    2694 
     2686            $this->queried_object_id = (int) $this->get('author');
     2687            $this->queried_object = get_userdata( $this->queried_object_id );
     2688        }
     2689debug($this->is_attachment, $this->is_page, $this->is_single);
    26952690        return $this->queried_object;
    26962691    }
Note: See TracChangeset for help on using the changeset viewer.