You probably want to use wp_get_current_user
to find out which user is browsing the site.
$current_user = wp_get_current_user();
echo 'User ID: ' . $current_user->ID . '<br />';
From there you’ll use the ID
to pull the user’s metadata with get_user_meta
.
$all_meta_for_user = get_user_meta( $current_user->ID );
echo 'User Description: ' . $all_meta_for_user['description'] . '<br />';
The description
key is probably what you’re after.
As you pointed out, the WP_User
already includes a few fields on it which may be duplicated in the user_meta, including $current_user->description
.
/**
11 * Core class used to implement the WP_User object.
12 *
13 * @since 2.0.0
14 *
15 * @property string $nickname
16 * @property string $description
17 * @property string $user_description
18 * @property string $first_name
19 * @property string $user_firstname
20 * @property string $last_name
21 * @property string $user_lastname
22 * @property string $user_login
23 * @property string $user_pass
24 * @property string $user_nicename
25 * @property string $user_email
26 * @property string $user_url
27 * @property string $user_registered
28 * @property string $user_activation_key
29 * @property string $user_status
30 * @property string $display_name
31 * @property string $spam
32 * @property string $deleted
33 */