| 369 | | $located = ''; |
| 370 | | foreach ( (array) $template_names as $template_name ) { |
| 371 | | if ( !$template_name ) |
| 372 | | continue; |
| 373 | | if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { |
| 374 | | $located = STYLESHEETPATH . '/' . $template_name; |
| 375 | | break; |
| 376 | | } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { |
| 377 | | $located = TEMPLATEPATH . '/' . $template_name; |
| 378 | | break; |
| | 369 | $located = apply_filters( 'locate_template_override', '', $template_names, $load, $require_once ); |
| | 370 | |
| | 371 | if ( empty( $located ) ) { |
| | 372 | foreach ( (array) $template_names as $template_name ) { |
| | 373 | if ( !$template_name ) |
| | 374 | continue; |
| | 375 | if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { |
| | 376 | $located = STYLESHEETPATH . '/' . $template_name; |
| | 377 | break; |
| | 378 | } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { |
| | 379 | $located = TEMPLATEPATH . '/' . $template_name; |
| | 380 | break; |
| | 381 | } |