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 $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(строка|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 1129
return apply_filters( 'get_comment_time', $comment_time, $format, $gmt, $translate, $comment );