added_(object_type)_meta
Fires immediately after adding metadata.
Usage
add_action( 'added_(object_type)_meta', 'wp_kama_added_object_type_meta_action', 10, 4 ); /** * Function for `added_(object_type)_meta` action-hook. * * @param int $meta_id ID of added metadata entry. * @param int $object_id Object ID. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. * * @return void */ function wp_kama_added_object_type_meta_action( $meta_id, $object_id, $meta_key, $meta_value ){ // action... }
- $meta_id(int)
- ID of added metadata entry.
- $object_id(int)
- Object ID.
- $meta_key(string)
- Metadata key.
- $meta_value(mixed)
- Metadata value.
Where the hook is called
woocommerce/includes/abstracts/abstract-wc-data.php 709
do_action( "added_{$this->object_type}_meta", $meta->id, $this->get_id(), $meta->key, $meta->value );
Where the hook is used in WooCommerce
woocommerce/src/Admin/API/Reports/Customers/DataStore.php 102
add_action( 'added_user_meta', array( __CLASS__, 'update_registered_customer_via_last_active' ), 10, 3 );