wp_update_comment_count()更新评论的总数

目录

描述

译文

在数据库中插入评论。

有效的$commetdata关键字名称包括 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_parent', 'comment_approved', 及'user_id'。

原文

Updates the comment count for post(s).

When $do_deferred is false (is by default) and the comments have been set to be deferred, $post_id will be added to a queue, which will be updated at a later date and only updated once per post ID.

If the comments have not be set up to be deferred, then the post will be updated. When $do_deferred is set to true, then all previous deferred post IDs will be updated along with the current $post_id.

wp_update_comment_count() 描述

用法

<?php wp_update_comment_count$post_id$do_deferred ?>

wp_update_comment_count() 用法

参数

$post_id

(integer) (必填) Post ID

默认值: None

$do_deferred

(boolean) (可选) Whether to process previously deferred post comment counts

默认值: false

wp_update_comment_count() 参数

返回值

(boolean) 

True on success, false on failure

wp_update_comment_count() 返回值

注意

wp_update_comment_count() 注意

历史

添加于 版本: 2.1.0

wp_update_comment_count() 历史

源文件

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

wp_update_comment_count() 源文件

相关