首页 WordPress函数大全 delete_metadata()

delete_metadata()

2020-05-01 / 3706阅 / 悠然

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

delete_metadata( string $meta_type, int $object_id, string $meta_key, mixed $meta_value = '', bool $delete_all = false )

Deletes 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)
(Required)
Metadata key.

$meta_value

(mixed)
(Optional)
Metadata value. Must be serializable if non-scalar. If specified,>Default value: ''

$delete_all

(bool)
(Optional)
If true, delete matching metadata entries for all objects, ignoring the specified object_id. Otherwise,>Default value: false

返回

(bool) True on successful delete, false on failure.

大家谈论
    我的见解