Rename wp_admin_bar_init to _wp_admin_bar_init and add a note that removing this action is the wrong way to do it.
git-svn-id: https://develop.svn.wordpress.org/trunk@17296 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
376207d61b
commit
d9b266ed25
@ -8,10 +8,14 @@
|
|||||||
/**
|
/**
|
||||||
* Instantiate the admin bar object and set it up as a global for access elsewhere.
|
* 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.
|
||||||
|
*
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
|
* @access private
|
||||||
* @return bool Whether the admin bar was successfully initialized.
|
* @return bool Whether the admin bar was successfully initialized.
|
||||||
*/
|
*/
|
||||||
function wp_admin_bar_init() {
|
function _wp_admin_bar_init() {
|
||||||
global $wp_admin_bar;
|
global $wp_admin_bar;
|
||||||
|
|
||||||
if ( ! is_admin_bar_showing() )
|
if ( ! is_admin_bar_showing() )
|
||||||
@ -32,7 +36,7 @@ function wp_admin_bar_init() {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
add_action( 'init', 'wp_admin_bar_init' );
|
add_action( 'init', '_wp_admin_bar_init' ); // Don't remove. Wrong way to disable.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the admin bar to the page based on the $wp_admin_bar->menu member var.
|
* Render the admin bar to the page based on the $wp_admin_bar->menu member var.
|
||||||
|
Loading…
Reference in New Issue
Block a user