Ticket #13239: 13239.c2c.3.diff
File 13239.c2c.3.diff, 1.3 KB (added by , 14 years ago) |
---|
-
wp-includes/theme.php
1067 1067 * inherit from a parent theme can just overload one file. 1068 1068 * 1069 1069 * @since 2.7.0 1070 * @uses apply_filters() Calls 'locate_template' filter on array of template names. 1070 1071 * 1071 1072 * @param string|array $template_names Template file(s) to search for, in order. 1072 1073 * @param bool $load If true the template file will be loaded if it is found. … … 1074 1075 * @return string The template filename if one is located. 1075 1076 */ 1076 1077 function locate_template($template_names, $load = false, $require_once = true ) { 1078 $template_names = apply_filters( 'locate_template', $template_names, $load, $require_once ); 1079 1077 1080 $located = ''; 1078 1081 foreach ( (array) $template_names as $template_name ) { 1079 1082 if ( !$template_name ) 1080 1083 continue; 1081 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 1084 if ( $template_name{0} == '/' && file_exists( $template_name ) ) { 1085 $located = $template_name; 1086 break; 1087 } else if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 1082 1088 $located = STYLESHEETPATH . '/' . $template_name; 1083 1089 break; 1084 1090 } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {