WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
фильтр не описан

get_(meta_type)_metadata хук-фильтр . WP 3.1.0

Short-circuits the return value of a meta field.

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.

Possible filter names include:

  • get_post_metadata
  • get_comment_metadata
  • get_term_metadata
  • get_user_metadata


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

	return $value;
The value to return, either a single metadata value or an array of values depending on the value of $single.
По умолчанию: null
ID of the object metadata is for.
Metadata key.
Whether to return only the first value of the specified $meta_key.
Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

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

С версии 3.1.0 Введена.
С версии 5.5.0 Added the $meta_type parameter.

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

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

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

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 61
add_filter( 'get_blog_metadata', 'wp_check_site_meta_support_prefilter' );
wp-includes/revision.php 613
add_filter( 'get_post_metadata', '_wp_preview_post_thumbnail_filter', 10, 3 );