Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_wp_admin_bar_init [ WordPress Function ]

_wp_admin_bar_init ( No parameters )
Access:
  • private
Returns:
  • (bool) Whether the admin bar was successfully initialized.
Defined at:



Instantiate the admin bar object and set it up as a global for access elsewhere.

To hide the admin bar, you're looking in the wrong place. Unhooking this function will not properly remove the admin bar. For that, use show_admin_bar(false) or the show_admin_bar filter.

Source


<?php
function _wp_admin_bar_init() {
    global 
$wp_admin_bar;

    if ( ! 
is_admin_bar_showing() )
        return 
false;

    
/* Load the admin bar class code ready for instantiation */
    
require( ABSPATH WPINC '/class-wp-admin-bar.php' );

    
/* Instantiate the admin bar */
    
$admin_bar_class apply_filters'wp_admin_bar_class''WP_Admin_Bar' );
    if ( 
class_exists$admin_bar_class ) )
        
$wp_admin_bar = new $admin_bar_class;
    else
        return 
false;

    
$wp_admin_bar->initialize();
    
$wp_admin_bar->add_menus();

    return 
true;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics