首页 WordPress函数大全 get_metadata()

get_metadata()

2020-05-01 / 5971阅 / 悠然

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

get_metadata( string $meta_type, int $object_id, string $meta_key = '', bool $single = false )

Retrieves metadata for the specified object.

描述

参数

$meta_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 metadata is for.

$meta_key

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

Default value: ''

$single

(bool)
(Optional)
If true, return>Default value: false

返回

(mixed) Single metadata value, or array of values

大家谈论
    我的见解