WordPress.org

Make WordPress Core

Ticket #30288: 30288.patch

File 30288.patch, 1.3 KB (added by Billy Mathews, 6 years ago)
  • general-template.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: C:\Users\win\Documents\Programming\WP\trunk\wp-includes
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    161161         */
    162162        do_action( "get_template_part_{$slug}", $slug, $name );
    163163
     164        $import_dirs = array();
     165        $import_dirs = apply_filters('template_part_import_directories', $import_dirs);
     166        $import_dirs[] = "";
     167       
    164168        $templates = array();
    165169        $name = (string) $name;
    166         if ( '' !== $name )
    167                 $templates[] = "{$slug}-{$name}.php";
     170        if ( '' !== $name ){
     171            for( $i = 0; $i < count($import_dirs); $i++ ){
     172                $templates[] = "{$import_dirs[$i]}/{$slug}-{$name}.php";
     173                $templates[] = "{$import_dirs[$i]}/{$slug}.php";
     174            }
     175        } else {
     176            for( $i = 0; $i < count($import_dirs); $i++ ){
     177                $templates[] = "{$import_dirs[$i]}/{$slug}.php";
     178            }
     179        }
    168180
    169         $templates[] = "{$slug}.php";
    170181
    171182        locate_template($templates, true, false);
    172183}