WordPress.org

Make WordPress Core

Ticket #20287: 20287.patch

File 20287.patch, 4.5 KB (added by johnbillion, 6 years ago)
  • wp-includes/default-filters.php

     
    193193add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object'        );
    194194
    195195// Actions
     196add_action( 'load_header',         'load_header'                            );
    196197add_action( 'wp_head',             'wp_enqueue_scripts',              1     );
    197198add_action( 'wp_head',             'feed_links',                      2     );
    198199add_action( 'wp_head',             'feed_links_extra',                3     );
     
    206207add_action( 'wp_head',             'wp_print_head_scripts',            9    );
    207208add_action( 'wp_head',             'wp_generator'                           );
    208209add_action( 'wp_head',             'rel_canonical'                          );
     210add_action( 'load_footer',         'load_footer'                            );
    209211add_action( 'wp_footer',           'wp_print_footer_scripts',         20    );
    210212add_action( 'wp_head',             'wp_shortlink_wp_head',            10, 0 );
    211213add_action( 'template_redirect',   'wp_shortlink_header',             11, 0 );
  • wp-includes/general-template.php

     
    1515 * For the parameter, if the file is called "header-special.php" then specify
    1616 * "special".
    1717 *
    18  * @uses locate_template()
    1918 * @since 1.5.0
    2019 * @uses do_action() Calls 'get_header' action.
     20 * @uses do_action() Calls 'load_header' action.
    2121 *
    2222 * @param string $name The name of the specialised header.
    2323 */
    2424function get_header( $name = null ) {
    2525        do_action( 'get_header', $name );
    26 
    27         $templates = array();
    28         if ( isset($name) )
    29                 $templates[] = "header-{$name}.php";
    30 
    31         $templates[] = 'header.php';
    32 
    33         // 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');
     26        do_action( 'load_header', $name );
    3627}
    3728
    3829/**
     
    4435 * For the parameter, if the file is called "footer-special.php" then specify
    4536 * "special".
    4637 *
    47  * @uses locate_template()
    4838 * @since 1.5.0
    4939 * @uses do_action() Calls 'get_footer' action.
     40 * @uses do_action() Calls 'load_footer' action.
    5041 *
    5142 * @param string $name The name of the specialised footer.
    5243 */
    5344function get_footer( $name = null ) {
    5445        do_action( 'get_footer', $name );
    55 
    56         $templates = array();
    57         if ( isset($name) )
    58                 $templates[] = "footer-{$name}.php";
    59 
    60         $templates[] = 'footer.php';
    61 
    62         // 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');
     46        do_action( 'load_footer', $name );
    6547}
    6648
    6749/**
  • wp-includes/template.php

     
    392392                require( $_template_file );
    393393}
    394394
     395/**
     396 * Load header template.
     397 *
     398 * Includes the header template for a theme or if a name is specified then a
     399 * specialised header will be included.
     400 *
     401 * For the parameter, if the file is called "header-special.php" then specify
     402 * "special".
     403 *
     404 * @since 3.4
     405 * @uses locate_template()
     406 *
     407 * @param string $name The name of the specialised header.
     408 */
     409function load_header( $name = null ) {
     410        $templates = array();
     411        if ( isset($name) )
     412                $templates[] = "header-{$name}.php";
     413
     414        $templates[] = 'header.php';
     415
     416        // Backward compat code will be removed in a future release
     417        if ('' == locate_template($templates, true))
     418                load_template( ABSPATH . WPINC . '/theme-compat/header.php');
     419}
     420
     421/**
     422 * Load footer template.
     423 *
     424 * Includes the footer template for a theme or if a name is specified then a
     425 * specialised footer will be included.
     426 *
     427 * For the parameter, if the file is called "footer-special.php" then specify
     428 * "special".
     429 *
     430 * @since 3.4
     431 * @uses locate_template()
     432 *
     433 * @param string $name The name of the specialised footer.
     434 */
     435function load_footer( $name = null ) {
     436        $templates = array();
     437        if ( isset($name) )
     438                $templates[] = "footer-{$name}.php";
     439
     440        $templates[] = 'footer.php';
     441
     442        // Backward compat code will be removed in a future release
     443        if ('' == locate_template($templates, true))
     444                load_template( ABSPATH . WPINC . '/theme-compat/footer.php');
     445}