get_comment_time WordPress Filter Hook

The get_comment_time WordPress hook is used to get the current time for a comment. This can be useful for checking how old a comment is, or for setting a comment expiration date.

apply_filters( 'get_comment_time', string|int $date, string $format, bool $gmt, bool $translate, WP_Comment $comment ) #

Filters the returned comment time.


Parameters

$date

(string|int)The comment time, formatted as a date string or Unix timestamp.

$format

(string)PHP date format.

$gmt

(bool)Whether the GMT date is in use.

$translate

(bool)Whether the time is translated.

$comment

(WP_Comment)The comment object.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More