Make WordPress Core

Changeset 21861


Ignore:
Timestamp:
09/15/2012 08:07:15 PM (12 years ago)
Author:
nacin
Message:

Expect a possible array of post types in get_archive_template(). props SergeyBiryukov. fixes #20867.

File:
1 edited

Legend:

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

    r20872 r21861  
    6060 */
    6161function get_archive_template() {
    62     $post_type = get_query_var( 'post_type' );
    63 
    64     $templates = array();
    65 
    66     if ( $post_type )
     62    $post_types = get_query_var( 'post_type' );
     63
     64    $templates = array();
     65
     66    foreach ( (array) $post_types as $post_type )
    6767        $templates[] = "archive-{$post_type}.php";
    6868    $templates[] = 'archive.php';
Note: See TracChangeset for help on using the changeset viewer.