Make WordPress Core

Ticket #28569: 28569.1.diff

File 28569.1.diff, 440 bytes (added by audrasjb, 3 years ago)

Toolbar: unhook the admin bar when a falsey value is used on show_admin_bar()

  • src/wp-includes/admin-bar.php

    diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php
    index b35a49fe1a..cdf519132f 100644
    a b function _admin_bar_bump_cb() { 
    11891189function show_admin_bar( $show ) {
    11901190        global $show_admin_bar;
    11911191        $show_admin_bar = (bool) $show;
     1192
     1193        if ( false === $show_admin_bar ) {
     1194                remove_action( 'wp_head', '_admin_bar_bump_cb' );
     1195        }
    11921196}
    11931197
    11941198/**