comments_number хук-фильтрWP 1.5.0

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 Введена.

Где вызывается хук

get_comments_number_text()
comments_number
wp-includes/comment-template.php 1004
return apply_filters( 'comments_number', $comments_number_text, $comments_number );

Где используется хук в WordPress

Использование не найдено.