Changeset 25386
- Timestamp:
- 09/12/2013 05:31:14 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/template.php
r25312 r25386 84 84 if ( is_array( $post_type ) ) 85 85 $post_type = reset( $post_type ); 86 86 87 87 $obj = get_post_type_object( $post_type ); 88 88 if ( ! $obj->has_archive ) … … 104 104 $templates = array(); 105 105 106 if ( $author) {106 if ( is_a( $author, 'WP_User' ) ) { 107 107 $templates[] = "author-{$author->user_nicename}.php"; 108 108 $templates[] = "author-{$author->ID}.php"; … … 130 130 $templates = array(); 131 131 132 if ( $category) {132 if ( ! empty( $category->slug ) ) { 133 133 $templates[] = "category-{$category->slug}.php"; 134 134 $templates[] = "category-{$category->term_id}.php"; … … 156 156 $templates = array(); 157 157 158 if ( $tag) {158 if ( ! empty( $tag->slug ) ) { 159 159 $templates[] = "tag-{$tag->slug}.php"; 160 160 $templates[] = "tag-{$tag->term_id}.php"; … … 187 187 $templates = array(); 188 188 189 if ( $term) {189 if ( ! empty( $term->slug ) ) { 190 190 $taxonomy = $term->taxonomy; 191 191 $templates[] = "taxonomy-$taxonomy-{$term->slug}.php"; … … 311 311 $templates = array(); 312 312 313 if ( $object)313 if ( ! empty( $object->post_type ) ) 314 314 $templates[] = "single-{$object->post_type}.php"; 315 315 $templates[] = "single.php"; … … 342 342 if ( $template = get_query_template( $type[0] ) ) 343 343 return $template; 344 elseif ( $template = get_query_template( $type[1] ) ) 345 return $template; 346 elseif ( $template = get_query_template( "$type[0]_$type[1]" ) ) 347 return $template; 344 elseif ( ! empty( $type[1] ) ) { 345 if ( $template = get_query_template( $type[1] ) ) 346 return $template; 347 elseif ( $template = get_query_template( "$type[0]_$type[1]" ) ) 348 return $template; 349 } 348 350 } 349 351 }
Note: See TracChangeset
for help on using the changeset viewer.