comments_number
Filters the comments count for display.
Использование
add_filter( 'comments_number', 'wp_kama_comments_number_filter', 10, 2 ); /** * Function for `comments_number` filter-hook. * * @param string $output A translatable string formatted based on whether the count is equal to 0, 1, or 1+. * @param int $number The number of post comments. * * @return string */ function wp_kama_comments_number_filter( $output, $number ){ // filter... return $output; }
- $output(строка)
- A translatable string formatted based on whether the count is equal to 0, 1, or 1+.
- $number(int)
- The number of post comments.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
comments_number
wp-includes/comment-template.php 949
return apply_filters( 'comments_number', $output, $number );