_wp_admin_bar_init [ WordPress Function ]
| Access: |
|
| Returns: |
|
| 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
- _wp_admin_bar_init (WordPress Function) - WPSeek.com
WordPress lookup for _wp_admin_bar_init, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Plugin API/Filter Reference « WordPress Codex
wp_admin_bar_class: allows changing the default 'WP_Admin_Bar' class in the _wp_admin_bar_init() function in wp-includes/admin-bar.php .
codex.wordpress.org - /wp-includes/admin-bar.php source - PHP Cross Reference ...
Jun 1, 2011 ... 17 */ 18 function _wp_admin_bar_init() { 19 global $wp_admin_bar; 20 21 if ( ! is_admin_bar_showing() ) 22 return false; 23 24 /* Load the ...
xref.yoast.com - Disable Admin Bar in WordPress 3.3 | Wptuts+
Dec 18, 2011 ... April 17, 2012 at 3:11 am. Hi, thanks for the tips, for 3.3.1, the following work for me remove_action('init','_wp_admin_bar_init');. Reply ...
wp.tutsplus.com