| 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 | /** |