Make WordPress Core


Ignore:
Timestamp:
10/10/2010 10:10:36 PM (14 years ago)
Author:
scribu
Message:

Allow string as first parameter to locate_template(). Props chrisbliss18 for initial patch. Fixes #15061

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r15739 r15771  
    10761076 * @since 2.7.0
    10771077 *
    1078  * @param array $template_names Array of template files to search for in priority order.
     1078 * @param string|array $template_names Template file(s) to search for, in order.
    10791079 * @param bool $load If true the template file will be loaded if it is found.
    10801080 * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
     
    10821082 */
    10831083function locate_template($template_names, $load = false, $require_once = true ) {
    1084     if ( !is_array($template_names) )
    1085         return '';
    1086 
    10871084    $located = '';
    1088     foreach ( $template_names as $template_name ) {
     1085    foreach ( (array) $template_names as $template_name ) {
    10891086        if ( !$template_name )
    10901087            continue;
Note: See TracChangeset for help on using the changeset viewer.