首页 WordPress函数大全 get_registered_metadata()

get_registered_metadata()

2020-05-01 / 2915阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

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

Retrieves registered metadata for a specified object.

描述

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

参数

$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: ''

返回

(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.

大家谈论
    我的见解