wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_get_admin_bar_pref › WordPress Function

Seit3.1.0
Veraltetn/v
_get_admin_bar_pref ( $context = 'front', $user = 0 )
Zugriff:
  • private
Parameter: (2)
  • (string) $context Context of this preference check. Defaults to 'front'. The 'admin' preference is no longer used.
    Erforderlich: Nein
    Standard: 'front'
  • (int) $user Optional. ID of the user to check, defaults to 0 for current user.
    Erforderlich: Nein
    Standard:
Gibt zurück:
  • (bool) Whether the admin bar should be showing for this user.
Definiert in:
Codex:

Retrieves the admin bar display preference of a user.



Quellcode

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;
}