WordPress at a glance

get_user_meta() WP 1.0

Retrieve user meta field for a user.

Works based on: get_metadata()
✈ 1 time = 0.000998s = slow | 50000 times = 0.09s = speed of light PHP 7.1.2, WP 4.7.5

No Hooks.

Return

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

Usage

get_user_meta( $user_id, $key, $single );
$user_id(int) (required)
User ID.
$key(string)
The meta key to retrieve. By default, returns data for all keys.
Default: ''
$single(true/false)
Whether to return a single value.
Default: false

Code of get_user_meta: wp-includes/user.php VER 4.9.8

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

Related Functions

From tag: Metadatas (any)

No comments
    Hello, !     Log In . Register