Changeset 47467
- Timestamp:
- 03/17/2020 07:26:34 PM (5 years ago)
- Location:
- branches/5.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
-
branches/5.4/src/wp-includes/admin-bar.php
r47198 r47467 56 56 * Renders the admin bar to the page based on the $wp_admin_bar->menu member var. 57 57 * 58 * This is called very late on the footer actions so that it will render after 59 * anything else being added to the footer. 58 * This is called very early on the {@see 'wp_body_open'} action so that it will render 59 * before anything else being added to the page body. 60 * 61 * For backward compatibility with themes not using the 'wp_body_open' action, 62 * the function is also called late on {@see 'wp_footer'}. 60 63 * 61 64 * It includes the {@see 'admin_bar_menu'} action which should be used to hook in and … … 65 68 * 66 69 * @since 3.1.0 70 * @since 5.4.0 Called on 'wp_body_open' action first, with 'wp_footer' as a fallback. 67 71 * 68 72 * @global WP_Admin_Bar $wp_admin_bar 73 * 74 * @staticvar bool $rendered 69 75 */ 70 76 function wp_admin_bar_render() { 71 77 global $wp_admin_bar; 78 static $rendered = false; 79 80 if ( $rendered ) { 81 return; 82 } 72 83 73 84 if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) { … … 101 112 */ 102 113 do_action( 'wp_after_admin_bar_render' ); 114 115 $rendered = true; 103 116 } 104 117 -
branches/5.4/src/wp-includes/default-filters.php
r47221 r47467 539 539 add_action( 'activate_header', '_wp_admin_bar_init' ); 540 540 add_action( 'wp_body_open', 'wp_admin_bar_render', 0 ); 541 add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); // Back-compat for themes not using `wp_body_open`. 541 542 add_action( 'in_admin_header', 'wp_admin_bar_render', 0 ); 542 543 -
branches/5.4/src/wp-includes/general-template.php
r47406 r47467 2894 2894 function wp_footer() { 2895 2895 /** 2896 * Sets up the Admin Bar if the current theme does not use `wp_body_open`.2897 *2898 * @since 5.4.02899 */2900 if ( ! did_action( 'wp_body_open' ) ) {2901 add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );2902 }2903 /**2904 2896 * Prints scripts or data before the closing body tag on the front end. 2905 2897 *
Note: See TracChangeset
for help on using the changeset viewer.