diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php
index a2b1296f5c..18b6d09c33 100644
a
|
b
|
add_action( 'template_redirect', '_wp_admin_bar_init', 0 ); |
537 | 537 | add_action( 'admin_init', '_wp_admin_bar_init' ); |
538 | 538 | add_action( 'before_signup_header', '_wp_admin_bar_init' ); |
539 | 539 | add_action( 'activate_header', '_wp_admin_bar_init' ); |
540 | | add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); |
| 540 | add_action( 'wp_body_open', 'wp_admin_bar_render', 0 ); |
541 | 541 | add_action( 'in_admin_header', 'wp_admin_bar_render', 0 ); |
542 | 542 | |
543 | 543 | // Former admin filters that can also be hooked on the front end |
diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
index 85aacb44ff..197e415f08 100644
a
|
b
|
function wp_head() { |
2889 | 2889 | * @since 1.5.1 |
2890 | 2890 | */ |
2891 | 2891 | function wp_footer() { |
| 2892 | /** |
| 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 | } |
2892 | 2900 | /** |
2893 | 2901 | * Prints scripts or data before the closing body tag on the front end. |
2894 | 2902 | * |