Switch language
wpseek on Twitter

A WordPress-centric search engine for devs and theme authors

_wp_admin_bar_init ›

_wp_admin_bar_init ( No parameters )
  • (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.

UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR. For that, use show_admin_bar(false) or the 'show_admin_bar' filter.


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 */

	 * Filter the admin bar class to instantiate.
	 * @since 3.1.0
	 * @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_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;
		return false;


	return true;

Top Google Search Results

User discussions [ wordpress.org ]

User Note(s)