wppaste
WordPress

_get_admin_bar_pref( string $context = 'front', int $user = 0 ): bool

Since
3.1.0
Source
wp-includes/admin-bar.php:1461
Retrieves the admin bar display preference of a user.

Parameters

$contextstringoptional
Context of this preference check. Defaults to 'front'. The 'admin' preference is no longer used.Default: 'front'
$userintoptional
ID of the user to check, defaults to 0 for current user.Default: 0

Return

bool
Whether the admin bar should be showing for this user.

Uses · 1

Used by · 1

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

History

Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/admin-bar.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.