1. 首页
  2. WordPress 函数手册

comment_exists()

comment_exists( string $comment_author, string $comment_date, string $timezone = ‘blog’ )

根据作者和日期确定是否存在注释。
Determine if a comment exists based on author and date.

目录锚点:#说明#参数#返回#源码


说明(Description)

为了获得最佳性能,请使用$timezone=’gmt’,它查询一个已正确索引的字段。由于传统原因,$timezone的默认值是’blog’。


参数(Parameters)

参数 类型 必填 说明
$comment_author (string) 必需 评论的作者。
$comment_date (string) 必需 评论的日期。
$timezone (string) 可选 时区。接受“blog”或“gmt”。

返回(Return)

(mixed)成功的评论帖子ID。


源码(Source)


更新版本 源码位置 使用 被使用
4.4.0 wp-admin/includes/comment.php:27 0 2

comment_exists() 为WP2原创文章,链接:https://www.wp2.cn/functions/comment_exists/