added_user_meta action-hookWP 2.9.0

Fires immediately after meta of a specific type is added.

This is one of the variants of the dynamic hook added_(meta_type)_meta

Usage

add_action( 'added_user_meta', 'wp_kama_added_user_meta_action', 10, 4 );

/**
 * Function for `added_user_meta` action-hook.
 * 
 * @param int    $mid         The meta ID after successful update.
 * @param int    $object_id   ID of the object metadata is for.
 * @param string $meta_key    Metadata key.
 * @param mixed  $_meta_value Metadata value.
 *
 * @return void
 */
function wp_kama_added_user_meta_action( $mid, $object_id, $meta_key, $_meta_value ){

	// action...
}
$mid(int)
The meta ID after successful update.
$object_id(int)
ID of the object metadata is for.
$meta_key(string)
Metadata key.
$_meta_value(mixed)
Metadata value.

Changelog

Since 2.9.0 Introduced.

Where the hook is called

add_metadata()
added_user_meta
wp-includes/meta.php 156
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );

Where the hook is used in WordPress

wp-includes/default-filters.php 119
add_action( 'added_user_meta', 'wp_cache_set_users_last_changed' );