Toolbar: Move the logic for rendering the admin bar on wp_footer to wp_admin_bar_render().

Clarify in the function documentation that it is now called on `wp_body_open` action first, with `wp_footer` as a fallback.

Follow-up to [47221].

Fixes #47053.

git-svn-id: https://develop.svn.wordpress.org/trunk@47455 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-03-14 15:59:22 +00:00
parent 31dd2e70f0
commit c3156e6258
3 changed files with 16 additions and 10 deletions

View File

@@ -2892,14 +2892,6 @@ function wp_head() {
* @since 1.5.1
*/
function wp_footer() {
/**
* Sets up the Admin Bar if the current theme does not use `wp_body_open`.
*
* @since 5.4.0
*/
if ( ! did_action( 'wp_body_open' ) ) {
add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
}
/**
* Prints scripts or data before the closing body tag on the front end.
*