Ticket #13239: 13239.6.diff
File 13239.6.diff, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/template.php
342 342 * inherit from a parent theme can just overload one file. 343 343 * 344 344 * @since 2.7.0 345 * @uses apply_filters() Calls 'locate_template' filter on array of template names. 345 346 * 346 347 * @param string|array $template_names Template file(s) to search for, in order. 347 348 * @param bool $load If true the template file will be loaded if it is found. … … 349 350 * @return string The template filename if one is located. 350 351 */ 351 352 function locate_template($template_names, $load = false, $require_once = true ) { 353 $template_names = apply_filters( 'locate_template', $template_names, $load, $require_once ); 354 352 355 $located = ''; 353 356 foreach ( (array) $template_names as $template_name ) { 354 357 if ( !$template_name ) 355 358 continue; 356 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 359 if ( path_is_absolute( $template_name ) && file_exists( $template_name ) ) { 360 $located = $template_name; 361 break; 362 } else if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 357 363 $located = STYLESHEETPATH . '/' . $template_name; 358 364 break; 359 365 } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {