Changeset 5126
- Timestamp:
- 09/08/2011 11:34:17 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-buddybar.php
r5119 r5126 525 525 526 526 /** 527 * Retrieve the admin bar display preference of a user based on context. 528 * 529 * This is a direct copy of WP's private _get_admin_bar_pref() 530 * 531 * @since 1.5.0 532 * 533 * @param string $context Context of this preference check, either 'admin' or 'front'. 534 * @param int $user Optional. ID of the user to check, defaults to 0 for current user. 535 * 536 * @uses get_user_option() 537 * 538 * @return bool Whether the admin bar should be showing for this user. 539 */ 540 function bp_get_admin_bar_pref( $context, $user = 0 ) { 541 $pref = get_user_option( "show_admin_bar_{$context}", $user ); 542 if ( false === $pref ) 543 return true; 544 545 return 'true' === $pref; 546 } 547 548 /** 527 549 * Handle the Admin Bar/BuddyBar business 528 550 * … … 551 573 // Show the WordPress admin bar 552 574 if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) { 575 // Respect user's admin bar display preferences 576 if ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) 577 return; 578 553 579 show_admin_bar( true ); 554 580
Note: See TracChangeset
for help on using the changeset viewer.