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 $comments_number_text A translatable string formatted based on whether the count is equal to 0, 1, or 1+. * @param int $comments_number The number of post comments. * * @return string */ function wp_kama_comments_number_filter( $comments_number_text, $comments_number ){ // filter... return $comments_number_text; }
- $comments_number_text(строка)
- A translatable string formatted based on whether the count is equal to 0, 1, or 1+.
- $comments_number(int)
- The number of post comments.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
comments_number
wp-includes/comment-template.php 1016
return apply_filters( 'comments_number', $comments_number_text, $comments_number );