Ticket #18331: 18331.diff
| File 18331.diff, 2.0 KB (added by scribu, 22 months ago) |
|---|
-
wp-includes/general-template.php
24 24 function get_header( $name = null ) { 25 25 do_action( 'get_header', $name ); 26 26 27 $templates = array();28 if ( isset($name) )29 $templates[] = "header-{$name}.php";30 31 $templates[] = 'header.php';32 33 27 // Backward compat code will be removed in a future release 34 if ( '' == locate_template($templates, true))35 load_template( ABSPATH . WPINC . '/theme-compat/header.php' );28 if ( '' == get_template_part( 'header', $name ) ) 29 load_template( ABSPATH . WPINC . '/theme-compat/header.php' ); 36 30 } 37 31 38 32 /** … … 53 47 function get_footer( $name = null ) { 54 48 do_action( 'get_footer', $name ); 55 49 56 $templates = array();57 if ( isset($name) )58 $templates[] = "footer-{$name}.php";59 60 $templates[] = 'footer.php';61 62 50 // Backward compat code will be removed in a future release 63 if ( '' == locate_template($templates, true))64 load_template( ABSPATH . WPINC . '/theme-compat/footer.php' );51 if ( '' == get_template_part( 'footer', $name ) ) 52 load_template( ABSPATH . WPINC . '/theme-compat/footer.php' ); 65 53 } 66 54 67 55 /** … … 79 67 * 80 68 * @param string $name The name of the specialised sidebar. 81 69 */ 82 function get_sidebar( $name = null ) {70 function get_sidebar( $name = null, $subfolder = null ) { 83 71 do_action( 'get_sidebar', $name ); 84 72 85 $templates = array();86 if ( isset($name) )87 $templates[] = "sidebar-{$name}.php";88 89 $templates[] = 'sidebar.php';90 91 73 // Backward compat code will be removed in a future release 92 if ( '' == locate_template($templates, true))93 load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php' );74 if ( '' == get_template_part( 'sidebar', $name ) ) 75 load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php' ); 94 76 } 95 77 96 78 /** … … 125 107 126 108 $templates[] = "{$slug}.php"; 127 109 128 locate_template($templates, true, false);110 return locate_template($templates, true, false); 129 111 } 130 112 131 113 /**
