WPDev.one
Core Function
View Source on Trac ↗

filter_default_metadata()

filter_default_metadata( mixed $value, mixed $object_id, mixed $meta_key, mixed $single, mixed $meta_type )

Filters into default_{$object_type}_metadata and adds in default value.

Parameters 5 required

Name / Type Description
$value
mixed

Current value passed to filter.

Required
$object_id
int

ID of the object metadata is for.

Required
$meta_key
string

Metadata key.

Required
bool

$single If true, return only the first value of the specified `$meta_key`. This parameter has no effect if `$meta_key` is not specified.

Required
string

$meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

Required

Return Value

(mixed)
mixed An array of default values if `$single` is false. The default value of the meta field if `$single` is true.

Function Information

Since Version
5.5.0
Source File
wp-includes/meta.php
Advertisement