get_comment_time
Filters the returned comment time.
Usage
add_filter( 'get_comment_time', 'wp_kama_get_comment_time_filter', 10, 5 ); /** * Function for `get_comment_time` filter-hook. * * @param string|int $comment_time The comment time, formatted as a date string or Unix timestamp. * @param string $format PHP date format. * @param bool $gmt Whether the GMT date is in use. * @param bool $translate Whether the time is translated. * @param WP_Comment $comment The comment object. * * @return string|int */ function wp_kama_get_comment_time_filter( $comment_time, $format, $gmt, $translate, $comment ){ // filter... return $comment_time; }
- $comment_time(string|int)
- The comment time, formatted as a date string or Unix timestamp.
- $format(string)
- PHP date format.
- $gmt(true|false)
- Whether the GMT date is in use.
- $translate(true|false)
- Whether the time is translated.
- $comment(WP_Comment)
- The comment object.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
get_comment_time
wp-includes/comment-template.php 1135
return apply_filters( 'get_comment_time', $comment_time, $format, $gmt, $translate, $comment );