WordPress.org

Make WordPress Core

Ticket #15730: 15730.diff

File 15730.diff, 1.0 KB (added by scribu, 7 years ago)
  • wp-includes/query.php

     
    26752675                                $this->queried_object = $term;
    26762676                                $this->queried_object_id = (int) $term->term_id;
    26772677                        }
     2678                } elseif ( $this->is_post_type_archive ) {
     2679                        $this->queried_object = get_post_type_object( $this->get('post_type') );
    26782680                } elseif ( $this->is_posts_page ) {
    26792681                        $page_for_posts = get_option('page_for_posts');
    26802682                        $this->queried_object = & get_page( $page_for_posts );
  • wp-includes/general-template.php

     
    667696        if ( ! is_post_type_archive() )
    668697                return;
    669698
    670 
    671         $post_type_obj = get_post_type_object( get_query_var( 'post_type' ) );
     699        $post_type_obj = get_queried_object();
    672700        $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
    673701
    674702        if ( $display )