update_comment_meta()更新一个评论的meta自定义附加信息

目录

描述

The function update_comment_meta() updates the value of an existing comment meta key for the specified comment.

This may be used in place of the add_comment_meta() function. The first thing this function will do is make sure that $meta_key already exists on $comment_id. If it does not it will be added.

update_comment_meta() 描述

用法

 <?php update_comment_meta$comment_id$meta_key$meta_value$prev_value ); ?> 

update_comment_meta() 用法

参数

$comment_id

(integer) (必填) The ID of the comment which contains the field you will edit.

默认值: None

$meta_key

(string) (必填) The key of the custom field you will edit.

默认值: None

$meta_value

(mixed) (必填) The new value of the custom field. A passed array will be serialized into a string.

默认值: None

$prev_value

(mixed) (可选) The old value of the custom field you wish to change. This is to differentiate between several fields with the same key. If omitted, and there are multiple rows for this post and meta key, all meta values will be updated.

默认值: None

update_comment_meta() 参数

返回值

(boolean

False on failure, true if success.

update_comment_meta() 返回值

示例

Default Usage

update_comment_meta() 示例

注意

历史

添加于 版本: 2.9.0

update_comment_meta() 历史

源文件

update_comment_meta() 函数的代码位于 wp-includes/comment.php

update_comment_meta() 源文件

相关