Advertisements

get_user_meta

Definition:
function get_user_meta($user_id, $key = '', $single = false) {}

Retrieve user meta field for a user.

Parameters

  • int $user_id: Post ID.
  • string $key: The meta key to retrieve.
  • bool $single: Whether to return a single value.

Return values

returns:Will be an array if $single is false. Will be value of meta data field if $single is true.

Source code

function get_user_meta($user_id, $key = '', $single = false) {

	return get_metadata('user', $user_id, $key, $single);

}

1899

Advertisements

One Response to “get_user_meta”

  1. hi,
    i use this function, but the return value is null..
    my code:

    $post_ids = get_user_meta(2,’user_favourite_post’);

    any help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: