Ticket #22355: 22355.5.patch
File 22355.5.patch, 1.2 KB (added by , 9 years ago) |
---|
-
wp-includes/template.php
502 502 */ 503 503 function locate_template($template_names, $load = false, $require_once = true ) { 504 504 $located = ''; 505 $locations = array( 506 get_stylesheet_directory(), 507 get_template_directory() 508 ); 509 510 /** 511 * Filter the possible template locations. 512 * 513 * @since unknown 514 * 515 * @param array $locations Possible template locations. 516 */ 517 $locations = apply_filters( 'template_locations', $locations ); 518 505 519 foreach ( (array) $template_names as $template_name ) { 506 520 if ( !$template_name ) 507 521 continue; 508 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 509 $located = STYLESHEETPATH . '/' . $template_name; 510 break; 511 } elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { 512 $located = TEMPLATEPATH . '/' . $template_name; 513 break; 522 523 foreach ( (array) $locations as $location ) { 524 $template_name = trailingslashit( $location ) . $template_name; 525 if ( file_exists( $template_name ) { 526 $located = $template_name; 527 break 2; 528 } 514 529 } 515 530 } 516 531