wppaste
WordPress

apply_filters( "get_{$meta_type}_metadata_by_mid", stdClass|null $value, int $meta_id )

Since
5.0.0
Short-circuits the return value when fetching a meta field 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:

  • get_blog_metadata_by_mid
  • get_post_metadata_by_mid
  • get_comment_metadata_by_mid
  • get_term_metadata_by_mid
  • get_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

$valuestdClass|null
The value to return.
$meta_idint
Meta ID.

Where this hook fires · 1

  • wp-includes/meta.php:854get_metadata_by_mid()

Source code

	 *	 * @since 5.0.0	 *	 * @param stdClass|null $value   The value to return.	 * @param int           $meta_id Meta ID.	 */	$check = apply_filters( "get_{$meta_type}_metadata_by_mid", null, $meta_id );	if ( null !== $check ) {		return $check;	} 	$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : '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.