delete_postmeta
Fires immediately before deleting post or comment metadata of a specific type.
This is one of the variants of the dynamic hook delete_(meta_type)meta
Usage
add_action( 'delete_postmeta', 'wp_kama_delete_postmeta_action' );
/**
* Function for `delete_postmeta` action-hook.
*
* @param int $meta_id ID of the metadata entry to delete.
*
* @return void
*/
function wp_kama_delete_postmeta_action( $meta_id ){
// action...
}
- $meta_id(int)
- ID of the metadata entry to delete.
Changelog
| Since 3.4.0 | Introduced. |
Where the hook is called
delete_postmeta
delete_postmeta
wp-includes/meta.php 1089
do_action( "delete_{$meta_type}meta", $meta_id );
wp-includes/meta.php 511
do_action( 'delete_postmeta', $meta_ids );