updated_postmeta
Fires immediately after updating a post's metadata.
Usage
add_action( 'updated_postmeta', 'wp_kama_updated_postmeta_action', 10, 4 );
/**
* Function for `updated_postmeta` action-hook.
*
* @param int $meta_id ID of updated metadata entry.
* @param int $object_id Post ID.
* @param string $meta_key Metadata key.
* @param mixed $meta_value Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string.
*
* @return void
*/
function wp_kama_updated_postmeta_action( $meta_id, $object_id, $meta_key, $meta_value ){
// action...
}
- $meta_id(int)
- ID of updated metadata entry.
- $object_id(int)
- Post ID.
- $meta_key(string)
- Metadata key.
- $meta_value(mixed)
- Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string.
Changelog
| Since 2.9.0 | Introduced. |
Where the hook is called
updated_postmeta
updated_postmeta
wp-includes/meta.php 367
do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
wp-includes/meta.php 995
do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );