Make WordPress Core

Ticket #14772: enabled_check_in_functions.php.diff

File enabled_check_in_functions.php.diff, 1.1 KB (added by neoxx, 15 years ago)
  • admin-bar.php

     
    1111function wp_admin_bar_init() {
    1212        global $current_user, $pagenow, $wp_admin_bar;
    1313
    14         if ( defined('WP_SHOW_ADMIN_BAR') )
    15                 $show_it = (bool) WP_SHOW_ADMIN_BAR;
    16         else
    17                 $show_it = true;
    18 
    19         if ( ! apply_filters( 'show_admin_bar', $show_it ) )
     14        if ( !show_admin_bar() )
    2015                return false;
    2116
    2217        /* Set the protocol constant used throughout this code */
  • functions.php

     
    44144414function no_admin_bar() {
    44154415        define('WP_SHOW_ADMIN_BAR', false);
    44164416}
     4417
     4418/**
     4419 * Checks if the admin bar has been enabled
     4420 *
     4421 * @since 3.1.0
     4422 */
     4423function show_admin_bar() {
     4424        $show_it=true;
     4425
     4426        if ( defined('WP_SHOW_ADMIN_BAR') )
     4427                $show_it = (bool) WP_SHOW_ADMIN_BAR;
     4428
     4429        if ( ! apply_filters( 'show_admin_bar', $show_it ) )
     4430                return false;
     4431
     4432        return true;
     4433}