Make WordPress Core

Ticket #13239: 22355.patch

File 22355.patch, 1.2 KB (added by jfarthing84, 9 years ago)

This patch may be relevant here.

  • wp-includes/template.php

     
    502502 */
    503503function locate_template($template_names, $load = false, $require_once = true ) {
    504504        $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
    505519        foreach ( (array) $template_names as $template_name ) {
    506520                if ( !$template_name )
    507521                        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                        }
    514529                }
    515530        }
    516531