WordPress at a glance

add_user_meta() WP 1.0

Adds meta data to a user.

Works based on: add_metadata()

No Hooks.

Return

Int/false. Meta ID on success, false on failure.

Usage

add_user_meta( $user_id, $meta_key, $meta_value, $unique );
$user_id(int) (required)
User ID.
$meta_key(string) (required)
Metadata name.
$meta_value(mixed) (required)
Metadata value.
$unique(true/false)
Whether the same key should not be added.
Default: false

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

<?php
function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
	return add_metadata('user', $user_id, $meta_key, $meta_value, $unique);
}

Related Functions

From tag: Metadatas (any)

No comments
    Hello, !     Log In . Register