get_registered_metadata

Advertisement

Summery Summery

Retrieves registered metadata for a specified object.

Syntax Syntax

get_registered_metadata( string $object_type, int $object_id, string $meta_key = '' )

Description Description

The results include both meta that is registered specifically for the object’s subtype and meta that is registered for the entire object type.

Parameters Parameters

$object_type

(string) (Required) Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

$object_id

(int) (Required) ID of the object the metadata is for.

$meta_key

(string) (Optional) Registered metadata key. If not specified, retrieve all registered metadata for the specified object.

Default value: ''

Return Return

(mixed) A single value or array of values for a key if specified. An array of all registered keys and values for an object ID if not. False if a given $meta_key is not registered.

Source Source

File: wp-includes/meta.php


			

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.