apply_filters( "get_{$meta_type}_metadata", null|array|string $value, int $object_id, string $meta_key, bool $single )

Filters whether to retrieve metadata of a specific type.

Description Description

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.

Top ↑

Parameters Parameters


(null|array|string) The value get_metadata() should return

  • a single metadata value, or an array of values.


(int) ID of the object metadata is for.


(string) Metadata key.


(bool) Whether to return only the first value of the specified $meta_key.

Top ↑

Source Source

File: wp-includes/meta.php

View on Trac

Top ↑

Changelog Changelog

Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by leogermani

    Note that although this filter filters the value that will be returned, you do not receive the current value as the first parameter.

    You allways receive null in the first parameter.

    If your callback returns anything else than null, this is the value that the function will return at the end. If you return null, the function will continue to run normally and try to fetch the data from the database (or cache).

You must log in before being able to contribute a note or feedback.