updated_postmeta
Fires immediately after updating a post's metadata.
Description
do_action( 'updated_postmeta', (int) $meta_id, (int) $object_id, (string) $meta_key, (mixed) $meta_value );
Parameters (4)
- 0. $meta_id (int)
- ID of updated metadata entry.
- 1. $object_id (int)
- The object id.
- 2. $meta_key (string)
- The meta key.
- 3. $meta_value (mixed)
- The meta value.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
- The following example is for adding a hook callback.
- // define the updated_postmeta callback
- function action_updated_postmeta( $meta_id, $object_id, $meta_key, $meta_value ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'updated_postmeta', 'action_updated_postmeta', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'updated_postmeta', 'action_updated_postmeta', 10, 4 );
Defined (2)
The action is defined in the following location(s).
- /wp-includes/meta.php
- do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
- do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );