WordPress at a glance
function is not described

_get_admin_bar_pref() WP 3.1.0

Retrieve the admin bar display preference of a user.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

true|false. Whether the admin bar should be showing for this user.

Usage

_get_admin_bar_pref( $context, $user );
$context(string)
Context of this preference check. The 'admin' preference is no longer used.
Default: 'front'
$user(int)
ID of the user to check.
Default: 0 for current user

Changelog

Since 3.1.0 Introduced.

Code of _get_admin_bar_pref() WP 5.7.2

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