WordPress.org

Make WordPress Core

Changeset 19315


Ignore:
Timestamp:
11/16/2011 10:55:59 PM (9 years ago)
Author:
ryan
Message:

Revert [18665]. Causes fatal double include in themes that call get_header() twice. see #18331

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r19304 r19315  
    2525    do_action( 'get_header', $name );
    2626
     27    $templates = array();
     28    if ( isset($name) )
     29        $templates[] = "header-{$name}.php";
     30
     31    $templates[] = 'header.php';
     32
    2733    // Backward compat code will be removed in a future release
    28     if ( '' == get_template_part( 'header', $name ) )
    29         load_template( ABSPATH . WPINC . '/theme-compat/header.php' );
     34    if ('' == locate_template($templates, true))
     35        load_template( ABSPATH . WPINC . '/theme-compat/header.php');
    3036}
    3137
     
    4854    do_action( 'get_footer', $name );
    4955
     56    $templates = array();
     57    if ( isset($name) )
     58        $templates[] = "footer-{$name}.php";
     59
     60    $templates[] = 'footer.php';
     61
    5062    // Backward compat code will be removed in a future release
    51     if ( '' == get_template_part( 'footer', $name ) )
    52         load_template( ABSPATH . WPINC . '/theme-compat/footer.php' );
     63    if ('' == locate_template($templates, true))
     64        load_template( ABSPATH . WPINC . '/theme-compat/footer.php');
    5365}
    5466
     
    7183    do_action( 'get_sidebar', $name );
    7284
     85    $templates = array();
     86    if ( isset($name) )
     87        $templates[] = "sidebar-{$name}.php";
     88
     89    $templates[] = 'sidebar.php';
     90
    7391    // Backward compat code will be removed in a future release
    74     if ( '' == get_template_part( 'sidebar', $name ) )
    75         load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php' );
     92    if ('' == locate_template($templates, true))
     93        load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
    7694}
    7795
     
    108126    $templates[] = "{$slug}.php";
    109127
    110     return locate_template($templates, true, false);
     128    locate_template($templates, true, false);
    111129}
    112130
Note: See TracChangeset for help on using the changeset viewer.