get_user_meta

Advertisement

Summery Summery

Retrieve user meta field for a user.

Syntax Syntax

get_user_meta( int $user_id, string $key = '', bool $single = false )

Parameters Parameters

$user_id

(Required) User ID.

$key

(Optional) The meta key to retrieve. By default, returns data for all keys.

Default value: ''

$single

(Optional) Whether to return a single value.

Default value: false

Return Return

(mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.

Source Source

File: wp-includes/user.php

 * @param int    $user_id User ID.
 * @param string $key     Optional. The meta key to retrieve. By default,
 *                        returns data for all keys.

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply