get_comment_time
Filters the returned comment time.
Использование
add_filter( 'get_comment_time', 'wp_kama_get_comment_time_filter', 10, 5 ); /** * Function for `get_comment_time` filter-hook. * * @param string|int $date 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( $date, $format, $gmt, $translate, $comment ){ // filter... return $date; }
- $date(строка|int)
- The comment time, formatted as a date string or Unix timestamp.
- $format(строка)
- 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.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
get_comment_time
wp-includes/comment-template.php 1060
return apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment );