Make WordPress Core

Ticket #33911: 33911.patch

File 33911.patch, 1.1 KB (added by sebastian.pisula, 11 years ago)
  • wp-includes/template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>windows-1250
     
    401401 */
    402402function locate_template($template_names, $load = false, $require_once = true ) {
    403403        $located = '';
     404
     405        $dirs = apply_filters('template_dirs', array(10 => STYLESHEETPATH, 20 => TEMPLATEPATH), $template_names);
     406
     407        ksort($dirs);
     408
    404409        foreach ( (array) $template_names as $template_name ) {
    405410                if ( !$template_name )
    406411                        continue;
    407                 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
    408                         $located = STYLESHEETPATH . '/' . $template_name;
    409                         break;
    410                 } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
    411                         $located = TEMPLATEPATH . '/' . $template_name;
    412                         break;
     412
     413                foreach($dirs AS $dir){
     414                        if ( file_exists($dir . '/' . $template_name)) {
     415                                $located = $dir . '/' . $template_name;
     416                                break;
     417                        }
    413418                }
    414419        }
    415420