WordPress at a glance
filter is not described

update_(meta_type)_metadata_by_mid filter-hook . WP 5.0.0

Short-circuits updating 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.


add_filter( 'update_(meta_type)_metadata_by_mid', 'filter_function_name_2762', 10, 4 );
function filter_function_name_2762( $check, $meta_id, $meta_value, $meta_key ){
	// filter...

	return $check;
Whether to allow updating metadata for the given type.
Meta ID.
Meta value. Must be serializable if non-scalar.
Meta key, if provided.

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

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

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

wp-includes/meta.php 816
$check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key );

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

wp-includes/default-filters.php 115
add_filter( 'update_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/ms-default-filters.php 66
add_filter( 'update_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );