do_action( "delete_{$meta_type}meta", int $meta_id )
- Since
- 3.4.0
Fires immediately before deleting post or comment metadata of a specific type.
Description
The dynamic portion of the hook name, $meta_type, refers to the meta object type (post or comment).
Possible hook names include:
delete_postmetadelete_commentmeta
Compatibility
- WordPress
- since 3.4.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$meta_idint- ID of the metadata entry to delete.
Where this hook fires · 1
wp-includes/meta.php:1089delete_metadata_by_mid()
Source code
* - `delete_commentmeta` * * @since 3.4.0 * * @param int $meta_id ID of the metadata entry to delete. */ do_action( "delete_{$meta_type}meta", $meta_id ); } // Run the query, will return true if deleted, false otherwise. $result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) ); // Clear the caches.Changelog
Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.