Make WordPress Core

Ticket #7549: 7549.trunk.diff

File 7549.trunk.diff, 1.4 KB (added by AaronCampbell, 18 years ago)

Patch for trunk

  • trunk/wp-includes/general-template.php

     
    22
    33/* Note: these tags go anywhere in the template */
    44
    5 function get_header() {
     5function get_header( $name = null ) {
    66        do_action( 'get_header' );
    7         if ('' == locate_template(array('header.php'), true))
     7
     8        $templates = array();
     9        if ( isset($name) )
     10                $templates[] = "header-{$name}.php";
     11
     12        $templates[] = "header.php";
     13
     14        if ('' == locate_template($templates, true))
    815                load_template( get_theme_root() . '/default/header.php');
    916}
    1017
    1118
    12 function get_footer() {
     19function get_footer( $name = null ) {
    1320        do_action( 'get_footer' );
    14         if ('' == locate_template(array('footer.php'), true))
     21
     22        $templates = array();
     23        if ( isset($name) )
     24                $templates[] = "footer-{$name}.php";
     25
     26        $templates[] = "footer.php";
     27
     28        if ('' == locate_template($templates, true))
    1529                load_template( get_theme_root() . '/default/footer.php');
    1630}
    1731
    1832
    1933function get_sidebar( $name = null ) {
    2034        do_action( 'get_sidebar' );
    21        
     35
    2236        $templates = array();
    2337        if ( isset($name) )
    2438                $templates[] = "sidebar-{$name}.php";
    25        
     39
    2640        $templates[] = "sidebar.php";
    27        
     41
    2842        if ('' == locate_template($templates, true))
    2943                load_template( get_theme_root() . '/default/sidebar.php');
    3044}