Make WordPress Core


Ignore:
Timestamp:
09/06/2013 11:38:51 PM (11 years ago)
Author:
wonderboymusic
Message:

Check the value passed to get_post_type_object(). If it's an array, use the first item. get_query_var( 'post_type' ) can be an array if the query has been altered via filters/actions. There are several places in core that pass the query var. Adds unit tests.

In template-loader.php, move is_post_type_archive() and is_tax() directly below is_home().

See #18614, [25291].

File:
1 edited

Legend:

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

    r25291 r25292  
    2727    if     ( is_404()            && $template = get_404_template()            ) :
    2828    elseif ( is_search()         && $template = get_search_template()         ) :
    29     elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
    30     elseif ( is_tax()            && $template = get_taxonomy_template()       ) :
    3129    elseif ( is_front_page()     && $template = get_front_page_template()     ) :
    3230    elseif ( is_home()           && $template = get_home_template()           ) :
     31    elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
     32    elseif ( is_tax()            && $template = get_taxonomy_template()       ) :
    3333    elseif ( is_attachment()     && $template = get_attachment_template()     ) :
    3434        remove_filter('the_content', 'prepend_attachment');
Note: See TracChangeset for help on using the changeset viewer.