A WordPress-centric search engine for devs and theme authors



_get_admin_bar_pref ›

Since3.1.0
Deprecatedn/a
_get_admin_bar_pref ( $context = 'front', $user = 0 )
Access:
  • private
Parameters: (2)
  • (string) $context Context of this preference check. Defaults to 'front'. The 'admin' preference is no longer used.
    Required: No
    Default: 'front'
  • (int) $user Optional. ID of the user to check, defaults to 0 for current user.
    Required: No
    Default:
Returns:
  • (bool) Whether the admin bar should be showing for this user.
Defined at:
Codex:

Retrieve the admin bar display preference of a user.



Source

function _get_admin_bar_pref( $context = 'front', $user = 0 ) {
	$pref = get_user_option( "show_admin_bar_{$context}", $user );
	if ( false === $pref )
		return true;

	return 'true' === $pref;
}