Changeset 15863
- Timestamp:
- 10/20/2010 01:23:39 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r15862 r15863 12 12 global $current_user, $pagenow, $wp_admin_bar; 13 13 14 if ( defined('WP_SHOW_ADMIN_BAR') ) 15 $show_it = (bool) WP_SHOW_ADMIN_BAR; 16 else 17 $show_it = true; 18 19 if ( ! apply_filters( 'show_admin_bar', $show_it ) ) 14 if ( ! show_admin_bar() ) 20 15 return false; 21 16 -
trunk/wp-includes/functions.php
r15846 r15863 4406 4406 4407 4407 /** 4408 * Prevents the admin bar from being shown for the current screen.4408 * Retrieve or set the admin bar display state. 4409 4409 * 4410 4410 * This can be called immediately upon plugin load. It does not need to be called from a function hooked to the init action. 4411 4411 * 4412 * @param bool $show Optional. True to show the admin bar, false to hide it. If not provided the current display state is returned. 4413 * @return bool The current display state if $show is not provided, the previous disply state if $show is provided. 4414 * 4412 4415 * @since 3.1.0 4413 4416 */ 4414 function no_admin_bar() { 4415 define('WP_SHOW_ADMIN_BAR', false); 4416 } 4417 function show_admin_bar( $show = null ) { 4418 static $show_admin_bar = null; 4419 4420 if ( !isset($show_admin_var) ) { 4421 if ( null !== $show ) 4422 $show_admin_bar = $show; 4423 elseif ( defined('WP_SHOW_ADMIN_BAR') ) 4424 $show_admin_bar = WP_SHOW_ADMIN_BAR; 4425 else 4426 $show_admin_bar = true; 4427 } 4428 4429 if ( null == $show ) { 4430 return $show_admin_bar; 4431 } else { 4432 $old_value = $show_admin_bar; 4433 $show_admin_bar = $show; 4434 return $old_value; 4435 } 4436 }
Note: See TracChangeset
for help on using the changeset viewer.