IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
453 | 453 | * inherit from a parent theme can just overload one file. |
454 | 454 | * |
455 | 455 | * @since 2.7.0 |
| 456 | * @uses apply_filters() Calls 'locate_template' filter on array of template names. |
456 | 457 | * |
457 | 458 | * @param string|array $template_names Template file(s) to search for, in order. |
458 | 459 | * @param bool $load If true the template file will be loaded if it is found. |
459 | 460 | * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false. |
460 | 461 | * @return string The template filename if one is located. |
461 | 462 | */ |
462 | | function locate_template($template_names, $load = false, $require_once = true ) { |
| 463 | function locate_template( $template_names, $load = false, $require_once = true ) { |
463 | 464 | $located = ''; |
464 | | foreach ( (array) $template_names as $template_name ) { |
465 | | if ( !$template_name ) |
| 465 | |
| 466 | /** |
| 467 | * Filter the array of template names passed to locate_filter(). |
| 468 | * |
| 469 | * Returning false will signal to locate_template() to simply return and not load any template. |
| 470 | * |
| 471 | * @since 3.9.0 |
| 472 | * |
| 473 | * @param string|array $template_names Template file or array of files to search for, in order. |
| 474 | */ |
| 475 | $template_names = apply_filters( 'locate_template', $template_names ); |
| 476 | |
| 477 | if ( false === $template_names ) |
| 478 | return false; |
| 479 | |
| 480 | foreach ( (array)$template_names as $template_name ) { |
| 481 | if ( ! $template_name ) { |
466 | 482 | continue; |
467 | | if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { |
468 | | $located = STYLESHEETPATH . '/' . $template_name; |
| 483 | } else if ( path_is_absolute( $template_name ) && file_exists( $template_name ) ) { |
| 484 | $located = $template_name; |
| 485 | } else if ( file_exists( $filepath = get_stylesheet_directory() . '/' . $template_name ) ) { |
| 486 | $located = $filepath; |
469 | 487 | break; |
470 | | } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { |
471 | | $located = TEMPLATEPATH . '/' . $template_name; |
| 488 | } else if ( file_exists( $filepath = get_template_directory() . '/' . $template_name ) ) { |
| 489 | $located = $filepath; |
472 | 490 | break; |
473 | 491 | } |
474 | 492 | } |
475 | 493 | |
476 | | if ( $load && '' != $located ) |
| 494 | if ( $load && '' != $located ) { |
477 | 495 | load_template( $located, $require_once ); |
| 496 | } |
478 | 497 | |
479 | 498 | return $located; |
480 | 499 | } |