metadata_exists()
metadata_exists( string $meta_type, int $object_id, string $meta_key )
确定是否为给定对象设置了元键。
Determines if a meta key is set for a given object.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$meta_type | (string) | 必需 | 对象元数据的类型是。接受“post”、“comment”、“term”、“user”或任何其他具有关联元表的对象类型。 |
$object_id | (int) | 必需 | 对象元数据的ID是。 |
$meta_key | (string) | 必需 | 元数据键。 |
返回(Return)
(bool)设置了键的True,否则为false。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.3.0 | wp-includes/meta.php:564 | 3 | 5 |
metadata_exists() 为WP2原创文章,链接:https://www.wp2.cn/functions/metadata_exists/