apply_filters( "delete_{$meta_type}_metadata_by_mid", null|bool $delete, int $meta_id )
- Since
- 5.0.0
Short-circuits deleting metadata of a specific type by meta ID.
Description
The dynamic portion of the hook name, $meta_type, refers to the meta object type (blog, post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
delete_blog_metadata_by_middelete_post_metadata_by_middelete_comment_metadata_by_middelete_term_metadata_by_middelete_user_metadata_by_mid
Compatibility
- WordPress
- since 5.0.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
$deletenull|bool- Whether to allow metadata deletion of the given type.
$meta_idint- Meta ID.
Where this hook fires · 1
wp-includes/meta.php:1055delete_metadata_by_mid()
Source code
* * @since 5.0.0 * * @param null|bool $delete Whether to allow metadata deletion of the given type. * @param int $meta_id Meta ID. */ $check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id ); if ( null !== $check ) { return (bool) $check; } // Fetch the meta and go on if it's found. $meta = get_metadata_by_mid( $meta_type, $meta_id );Changelog
Introduced in 5.0.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 7.1.0 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.