Changeset 12010
- Timestamp:
- 10/08/2009 05:27:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r11971 r12010 619 619 * Retrieve path of tag template in current or parent template. 620 620 * 621 * Works by retrieving the current tag name, for example 'tag-wordpress.php' and will 622 * fallback to tag.php template, if the name tag file doesn't exist. 623 * 621 * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then 622 * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php 623 * template, if those files don't exist. 624 * 624 625 * @since 2.3.0 625 626 * @uses apply_filters() Calls 'tag_template' on file path of tag template. … … 628 629 */ 629 630 function get_tag_template() { 630 $template = locate_template(array("tag-" . get_query_var('tag') . '.php', 'tag.php')); 631 $tag_id = absint( get_query_var('tag_id') ); 632 $tag_name = get_query_var('tag'); 633 634 $templates = array(); 635 636 if ( $tag_name ) 637 $templates[] = "tag-$tag_name.php"; 638 if ( $tag_id ) 639 $templates[] = "tag-$tag_id.php"; 640 $templates[] = "tag.php"; 641 642 $template = locate_template($templates); 631 643 return apply_filters('tag_template', $template); 632 644 }
Note: See TracChangeset
for help on using the changeset viewer.