Changeset 18700 for trunk/wp-includes/admin-bar.php
- Timestamp:
- 09/17/2011 10:26:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r18696 r18700 541 541 global $show_admin_bar, $pagenow; 542 542 543 / * For all these types of request we never want an admin bar period */543 // For all these types of requests, we never want an admin bar. 544 544 if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') ) 545 545 return false; 546 547 // Integrated into the admin. 548 if ( is_admin() ) 549 return true; 546 550 547 551 if ( ! isset( $show_admin_bar ) ) { … … 549 553 $show_admin_bar = false; 550 554 } else { 551 $context = is_admin() ? 'admin' : 'front'; 552 $show_admin_bar = _get_admin_bar_pref( $context ); 555 $show_admin_bar = _get_admin_bar_pref(); 553 556 } 554 557 } … … 560 563 561 564 /** 562 * Retrieve the admin bar display preference of a user based on context.565 * Retrieve the admin bar display preference of a user. 563 566 * 564 567 * @since 3.1.0 565 568 * @access private 566 569 * 567 * @param string $context Context of this preference check, either 'admin' or 'front'. 570 * @param string $context Context of this preference check. Defaults to 'front'. The 'admin' 571 * preference is no longer used. 568 572 * @param int $user Optional. ID of the user to check, defaults to 0 for current user. 569 573 * @return bool Whether the admin bar should be showing for this user. 570 574 */ 571 function _get_admin_bar_pref( $context , $user = 0 ) {575 function _get_admin_bar_pref( $context = 'front', $user = 0 ) { 572 576 $pref = get_user_option( "show_admin_bar_{$context}", $user ); 573 577 if ( false === $pref )
Note: See TracChangeset
for help on using the changeset viewer.