apply_filters( "default_{$meta_type}_metadata", mixed $value, int $object_id, string $meta_key, bool $single, string $meta_type )
- Since
- 5.5.0
Filters the default metadata value for a specified meta key and object.
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). Possible filter names include: <ul> <li>default_blog_metadata</li> <li>default_post_metadata</li> <li>default_comment_metadata</li> <li>default_term_metadata</li> <li>default_user_metadata</li> </ul>Parameters
$valuemixed- The value to return, either a single metadata value or an array of values depending on the value of
$single. $object_idint- ID of the object metadata is for.
$meta_keystring- Metadata key.
$singlebool- Whether to return only the first value of the specified
$meta_key. $meta_typestring- Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
Fired at · 1
wp-includes/meta.php:747get_metadata_default()
Source
* @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', * 'user', or any other object type with an associated meta table. */ $value = apply_filters( "default_{$meta_type}_metadata", $value, $object_id, $meta_key, $single, $meta_type ); if ( ! $single && ! wp_is_numeric_array( $value ) ) { $value = array( $value ); } return $value;History
Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 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.