Description
Operates exactly like WP’s get_user_meta(), but without the need for $single (always returns a string).
Parameters
$user_id
(integer) (required) The user ID to check.
$key
(string) (required) The meta key to get.
Return Value
(mixed) The value of meta field if it exists. False for an invalid $user_id or if no $key value exists.
Examples
// Works the same as WP's get_user_meta(), but without the $single argument. // @see https://developer.wordpress.org/reference/functions/get_user_meta/ // Get user first and last name (meta keys "first_name" and "last_name"): $first_name = wpmem_get_user_meta( $user_id, 'first_name' ); $last_name = wpmem_get_user_meta( $user_id, 'last_name' );
Changelog
Introduced in version 3.3.0
Source
wpmem_get_user_meta() is located in /includes/api-users.php.