Ticket #25558: general-template.patch
| File general-template.patch, 923 bytes (added by , 13 years ago) |
|---|
-
.php
old new 119 119 * @param string $slug The slug name for the generic template. 120 120 * @param string $name The name of the specialised template. 121 121 */ 122 function get_template_part( $slug, $name = null ) { 123 do_action( "get_template_part_{$slug}", $slug, $name ); 122 function get_template_part() { 123 $partials = array_filter( func_get_args() ); 124 do_action( "get_template_part_{$slug}", $partials[0], $partials[1], $partials ); // $partials[1] for compability 124 125 125 126 $templates = array(); 126 $name = (string) $name;127 if ( '' !== $name )128 $templates[] = "{$slug}-{$name}.php";129 130 $templates[] = "{$slug}.php";127 if ( $partials ) 128 foreach( $partials as $partial ) { 129 $templates[] = implode( '-', $partials ) . '.php'; 130 array_pop($partials); 131 } 131 132 132 133 locate_template($templates, true, false); 133 134 }