add_user_meta() – Adds meta data to a user.

You appear to be a bot. Output may be restricted

Description

Adds meta data to a user.

Usage

$int|false = add_user_meta( $user_id, $meta_key, $meta_value, $unique );

Parameters

$user_id
( int ) required – User ID.
$meta_key
( string ) required – Metadata name.
$meta_value
( mixed ) required – Metadata value. Must be serializable if non-scalar.
$unique
( bool ) optional – Optional. Whether the same key should not be added. Default false.

Returns

int|false Meta ID on success, false on failure.

Source

File name: wordpress/wp-includes/user.php
Lines:

1 to 3 of 3
function add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) {
  return add_metadata( 'user', $user_id, $meta_key, $meta_value, $unique );
}
 

 View on GitHub View on Trac