A WordPress-centric search engine for devs and theme authors



get_user_meta ›

Since3.0.0
Deprecatedn/a
get_user_meta ( $user_id, $key = '', $single = false )
Parameters: (3)
  • (int) $user_id User ID.
    Required: Yes
  • (string) $key Optional. The meta key to retrieve. By default, returns data for all keys.
    Required: No
    Default: (empty)
  • (bool) $single Whether to return a single value.
    Required: No
    Default: false
Links:
Returns:
  • (mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.
Defined at:
Codex:

Retrieve user meta field for a user.



Source

function get_user_meta($user_id, $key = '', $single = false) {
	return get_metadata('user', $user_id, $key, $single);
}