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: http://svn.automattic.com/wordpress/trunk@17296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-01-14 05:57:25 +00:00
parent 8a5691b6f8
commit 1968829603

View File

@ -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.