wppaste
WordPress

apply_filters( "update_{$meta_type}_metadata_by_mid", null|bool $check, int $meta_id, mixed $meta_value, string|false $meta_key )

Since
5.0.0
Short-circuits updating 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:

  • update_blog_metadata_by_mid
  • update_post_metadata_by_mid
  • update_comment_metadata_by_mid
  • update_term_metadata_by_mid
  • update_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

$checknull|bool
Whether to allow updating metadata for the given type.
$meta_idint
Meta ID.
$meta_valuemixed
Meta value. Must be serializable if non-scalar.
$meta_keystring|false
Meta key, if provided.

Where this hook fires · 1

  • wp-includes/meta.php:931update_metadata_by_mid()

Source code

	 *	 * @param null|bool    $check      Whether to allow updating metadata for the given type.	 * @param int          $meta_id    Meta ID.	 * @param mixed        $meta_value Meta value. Must be serializable if non-scalar.	 * @param string|false $meta_key   Meta key, if provided.	 */	$check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key );	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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.