]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/template.php
Wordpress 3.6-scripts
[autoinstalls/wordpress.git] / wp-includes / template.php
index d86a677fb604d66bbc9cd508c1e95f613a9fe963..5bee8ad52d17b0fe9ed4a55ea65037d0faf75089 100644 (file)
@@ -59,12 +59,14 @@ function get_404_template() {
  * @return string
  */
 function get_archive_template() {
-       $post_types = get_query_var( 'post_type' );
+       $post_types = array_filter( (array) get_query_var( 'post_type' ) );
 
        $templates = array();
 
-       foreach ( (array) $post_types as $post_type )
+       if ( count( $post_types ) == 1 ) {
+               $post_type = reset( $post_types );
                $templates[] = "archive-{$post_type}.php";
+       }
        $templates[] = 'archive.php';
 
        return get_query_template( 'archive', $templates );
@@ -94,8 +96,8 @@ function get_author_template() {
 /**
  * Retrieve path of category template in current or parent template.
  *
- * Works by first retrieving the current slug for example 'category-default.php' and then
- * trying category ID, for example 'category-1.php' and will finally fallback to category.php
+ * Works by first retrieving the current slug, for example 'category-default.php', and then
+ * trying category ID, for example 'category-1.php', and will finally fall back to category.php
  * template, if those files don't exist.
  *
  * @since 1.5.0
@@ -120,8 +122,8 @@ function get_category_template() {
 /**
  * Retrieve path of tag template in current or parent template.
  *
- * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then
- * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php
+ * Works by first retrieving the current tag name, for example 'tag-wordpress.php', and then
+ * trying tag ID, for example 'tag-1.php', and will finally fall back to tag.php
  * template, if those files don't exist.
  *
  * @since 2.3.0
@@ -189,7 +191,7 @@ function get_date_template() {
 /**
  * Retrieve path of home template in current or parent template.
  *
- * This is the template used for the page containing the blog posts
+ * This is the template used for the page containing the blog posts.
  *
  * Attempts to locate 'home.php' first before falling back to 'index.php'.
  *
@@ -223,9 +225,9 @@ function get_front_page_template() {
 /**
  * Retrieve path of page template in current or parent template.
  *
- * Will first look for the specifically assigned page template
- * The will search for 'page-{slug}.php' followed by 'page-id.php'
- * and finally 'page.php'
+ * Will first look for the specifically assigned page template.
+ * Then will search for 'page-{slug}.php', followed by 'page-{id}.php',
+ * and finally 'page.php'.
  *
  * @since 1.5.0
  *