WordPress at a glance
filter is not described

delete_(meta_type)_metadata_by_mid filter-hook . WP 5.0.0

Short-circuits deleting metadata of a specific type by meta ID.

The dynamic portion of the hook, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table). Returning a non-null value will effectively short-circuit the function.

Usage

add_filter( 'delete_(meta_type)_metadata_by_mid', 'filter_function_name_2839', 10, 2 );
function filter_function_name_2839( $delete, $meta_id ){
	// filter...

	return $delete;
}
$delete(null/true/false)
Whether to allow metadata deletion of the given type.
$meta_id(int)
Meta ID.

Список изменений

С версии 5.0.0 Введена.

Где вызывается хук

delete_metadata_by_mid()
delete_(meta_type)_metadata_by_mid
wp-includes/meta.php 930
$check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id );

Где используется хук в ядре WP

wp-includes/default-filters.php 116
add_filter( 'delete_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/ms-default-filters.php 67
add_filter( 'delete_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );