WordPress at a glance
filter is not described

get_(meta_type)_metadata filter-hook . WP 3.1.0

Filters whether to retrieve metadata of a specific type.

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


add_filter( 'get_(meta_type)_metadata', 'filter_function_name_1814', 10, 4 );
function filter_function_name_1814( $value, $object_id, $meta_key, $single ){
	// filter...

	return $value;
The value get_metadata() should return - a single metadata value, or an array of values.
ID of the object metadata is for.
Metadata key.
Whether to return only the first value of the specified $meta_key.


Since 3.1.0 Introduced.

Where the hook is called

wp-includes/meta.php 514
$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
wp-includes/meta.php 575
$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true );

Where in WP core the hook is used

wp-admin/includes/class-wp-site-icon.php 73
add_filter( 'get_post_metadata', array( $this, 'get_post_metadata' ), 10, 4 );
wp-includes/default-filters.php 110
add_filter( 'get_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/ms-default-filters.php 60
add_filter( 'get_blog_metadata', 'wp_check_site_meta_support_prefilter' );
wp-includes/revision.php 579
add_filter( 'get_post_metadata', '_wp_preview_post_thumbnail_filter', 10, 3 );