Ticket #13239: 13239.c2c.2.diff
File 13239.c2c.2.diff, 1.9 KB (added by , 14 years ago) |
---|
-
wp-includes/theme.php
1035 1035 * inherit from a parent theme can just overload one file. 1036 1036 * 1037 1037 * @since 2.7.0 1038 * @uses apply_filters() Calls 'locate_template' filter on array of template names. 1039 * @uses apply_filters() Calls "locate_template-$template_name" filter on template name. 1040 * @uses apply_filters() Calls "locate_template_path-$template_name" filter on empty string, to be used to explicit define a template path. 1041 * @uses apply_filters() Calls 'locate_template_located' filter on located template. 1038 1042 * 1039 1043 * @param array $template_names Array of template files to search for in priority order. 1040 1044 * @param bool $load If true the template file will be loaded if it is found. … … 1045 1049 if ( !is_array($template_names) ) 1046 1050 return ''; 1047 1051 1052 $template_names = apply_filters( 'locate_template', $template_names, $load, $require_once ); 1053 1048 1054 $located = ''; 1049 1055 foreach ( $template_names as $template_name ) { 1056 $template_name = apply_filters( "locate_template-$template_name", $template_name, $load, $require_once ); 1050 1057 if ( !$template_name ) 1051 1058 continue; 1052 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 1059 $template_path = apply_filters( "locate_template_path-$template_name", '', $template_name, $load, $require_once ); 1060 if ( !empty( $template_path ) && file_exists( $template_path ) ) { 1061 $located = $template_path; 1062 break; 1063 } else if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 1053 1064 $located = STYLESHEETPATH . '/' . $template_name; 1054 1065 break; 1055 1066 } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { … … 1058 1069 } 1059 1070 } 1060 1071 1072 $located = apply_filters( 'locate_template_located', $located, $template_names, $load, $require_once ); 1073 1061 1074 if ( $load && '' != $located ) 1062 1075 load_template( $located, $require_once ); 1063 1076