comment_exists

SummerySummery

Determine if a comment exists based on author and date.

Syntax

comment_exists( string $comment_author, string $comment_date, string $timezone = 'blog' )

DescriptionDescription

For best performance, use $timezone = 'gmt', which queries a field that is properly indexed. The default value for $timezone is ‘blog’ for legacy reasons.

ParametersParameters

$comment_author

(string) (Required) Author of the comment.

$comment_date

(string) (Required) Date of the comment.

$timezone

(string) (Optional) Timezone. Accepts 'blog' or 'gmt'.

Default value: 'blog'

ReturnReturn

(mixed) Comment post ID on success.

SourceSource

File: wp-admin/includes/comment.php


			

ChangelogChangelog

Changelog
Version Description
4.4.0 Added the $timezone parameter.
2.0.0 Introduced.
Scroll to Top