Ticket #18614: 18614.diff
File 18614.diff, 4.0 KB (added by , 13 years ago) |
---|
-
wp-includes/template-loader.php
22 22 $template = false; 23 23 if ( is_404() && $template = get_404_template() ) : 24 24 elseif ( is_search() && $template = get_search_template() ) : 25 elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) : 25 26 elseif ( is_tax() && $template = get_taxonomy_template() ) : 26 27 elseif ( is_front_page() && $template = get_front_page_template() ) : 27 28 elseif ( is_home() && $template = get_home_template() ) : -
wp-includes/theme.php
793 793 } 794 794 795 795 /** 796 * Retrieve path of post type archive template in current or parent template. 797 * 798 * @since 3.4.0 799 * 800 * @return string 801 */ 802 function get_post_type_archive_template() { 803 $post_type = get_query_var( 'post_type' ); 804 805 $obj = get_post_type_object( $post_type ); 806 if ( ! $obj->has_archive ) 807 return ''; 808 809 return get_archive_template(); 810 } 811 812 /** 796 813 * Retrieve path of author template in current or parent template. 797 814 * 798 815 * @since 1.5.0 -
wp-includes/query.php
2929 2929 $this->queried_object = null; 2930 2930 $this->queried_object_id = 0; 2931 2931 2932 if ( $this->is_category || $this->is_tag || $this->is_tax ) { 2932 if ( $this->is_post_type_archive ) 2933 $post_type_object = get_post_type_object( $this->get('post_type') ); 2934 2935 if ( $this->is_post_type_archive && $post_type_object->has_archive ) { 2936 $this->queried_object = $post_type_object; 2937 } elseif ( $this->is_category || $this->is_tag || $this->is_tax ) { 2933 2938 $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' ); 2934 2939 2935 2940 $query = reset( $tax_query_in_and ); … … 2947 2952 _make_cat_compat( $this->queried_object ); 2948 2953 } 2949 2954 } elseif ( $this->is_post_type_archive ) { 2950 $this->queried_object = get_post_type_object( $this->get('post_type') );2955 $this->queried_object = $post_type_object; 2951 2956 } elseif ( $this->is_posts_page ) { 2952 2957 $page_for_posts = get_option('page_for_posts'); 2953 2958 $this->queried_object = & get_page( $page_for_posts ); -
wp-includes/general-template.php
662 662 return; 663 663 664 664 $post_type_obj = get_queried_object(); 665 if ( empty( $post_type_obj->has_archive ) ) 666 $post_type_obj = get_post_type_object( get_post_type() ); 667 665 668 $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name ); 666 669 667 670 if ( $display ) … … 1633 1636 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 1634 1637 /* translators: 1: blog name, 2: separator(raquo), 3: search phrase */ 1635 1638 'searchtitle' => __('%1$s %2$s Search Results for “%3$s” Feed'), 1639 /* translators: 1: blog name, 2: separator(raquo), 3: generic feed */ 1640 'generic' => __('%1$s %2$s %3$s Feed'), 1636 1641 ); 1637 1642 1638 1643 $args = wp_parse_args( $args, $defaults ); 1639 1644 1640 if ( is_sing le() || is_page() ) {1645 if ( is_singular() ) { 1641 1646 $id = 0; 1642 1647 $post = &get_post( $id ); 1643 1648 … … 1645 1650 $title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) ); 1646 1651 $href = get_post_comments_feed_link( $post->ID ); 1647 1652 } 1653 } elseif ( is_post_type_archive() ) { 1654 $post_type_obj = get_queried_object(); 1655 1656 $title = sprintf( $args['generic'], get_bloginfo('name'), $args['separator'], $post_type_obj->labels->name ); 1657 $href = get_post_type_archive_feed_link( $post_type_obj->name ); 1648 1658 } elseif ( is_category() ) { 1649 1659 $term = get_queried_object(); 1650 1660