Make WordPress Core


Ignore:
Timestamp:
02/09/2020 06:24:41 PM (5 years ago)
Author:
joedolson
Message:

Toolbar: Load toolbar in wp_body_open when available.

For accessibility, the visual appearance and source order should match. Moving the toolbar to load in the new hook wp_body_open (5.2) fixes a long-standing source order problem.

Props jankimoradiya, afercia, SergeyBiryukov, audrasjb, ocean90, xkon, dinhtungdu.
Fixes #47053.

File:
1 edited

Legend:

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

    r47219 r47221  
    28912891function wp_footer() {
    28922892    /**
     2893     * Sets up the Admin Bar if the current theme does not use `wp_body_open`.
     2894     *
     2895     * @since 5.4.0
     2896     */
     2897    if ( ! did_action( 'wp_body_open' ) ) {
     2898        add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
     2899    }
     2900    /**
    28932901     * Prints scripts or data before the closing body tag on the front end.
    28942902     *
Note: See TracChangeset for help on using the changeset viewer.