[wp-trac] [WordPress Trac] #28569: Calling show_admin_bar( false ) should dehook toolbar entirely

WordPress Trac noreply at wordpress.org
Mon Oct 25 01:09:06 UTC 2021


#28569: Calling show_admin_bar( false ) should dehook toolbar entirely
-------------------------------------+----------------------------
 Reporter:  danielbachhuber          |       Owner:  davidbaumwald
     Type:  enhancement              |      Status:  reviewing
 Priority:  normal                   |   Milestone:  5.9
Component:  Toolbar                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-refresh  |     Focuses:
-------------------------------------+----------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch commit => has-patch needs-refresh


Comment:

 Removing the commit keyword as it needs a little extra work:

 * `admin-bar.css` is still enqueued in the header
 * `admin-bar.js` is still enqueued in the footer
 * `<style media="print">#wpadminbar { display:none; }</style>` is still
 output in the header (harmless but not ideal)
 * it's possible for themes & plugins to set a custom callback
 `add_theme_support( 'admin-bar', array( 'callback' => '28569_admin_bar_cb'
 ) );`

 Testing notes: added `show_admin_bar( false );` to my theme's `header.php`
 prior to the `wp_head()` function call.

 I'll reach out to a Jetpack team member to ensure they're aware of this
 change coming so they can check for compatibility with the WordPress.com
 bar. I'd rather not surprise them and break 5 million sites.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/28569#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list