add_user_meta

Advertisement

Summery Summery

Adds meta data to a user.

Syntax Syntax

add_user_meta( int $user_id, string $meta_key, mixed $meta_value, bool $unique = false )

Parameters Parameters

$user_id

(int) (Required) User ID.

$meta_key

(string) (Required) Metadata name.

$meta_value

(mixed) (Required) Metadata value.

$unique

(bool) (Optional) Whether the same key should not be added.

Default value: false

Return Return

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

Source Source

File: wp-includes/user.php

 */
function add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) {
	return add_metadata( 'user', $user_id, $meta_key, $meta_value, $unique );

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.