Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_metadata_default()

3 tags 1 category

get_metadata_default() — Retrieves default metadata value for the specified meta key and object. By default, an empty string is returned if $single is true, or an empty array if it’s false.

Inputs: $meta_type (string): Type of object metadata is for. Accepts ‘blog’, ‘post’, ‘comment’, ‘term’, ‘user’, or any other object type with an associated meta table. $object_id (int): ID of the object metadata is for. $meta_key (string): Metadata key. $single (bool): Optional. If true, return only the first value of the specified $meta_key. This parameter has no effect if $meta_key is not specified. Default false.

Returns mixed: An array of default values if $single is false. The default value of the meta field if $single is true.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…