WordPress Version: 3.9
/**
* Display the language string for the number of comments the current post has.
*
* @since 0.71
*
* @param string $zero Optional. Text for no comments. Default false.
* @param string $one Optional. Text for one comment. Default false.
* @param string $more Optional. Text for more than one comment. Default false.
* @param string $deprecated Not used.
*/
function comments_number($zero = false, $one = false, $more = false, $deprecated = '')
{
if (!empty($deprecated)) {
_deprecated_argument(__FUNCTION__, '1.3');
}
$number = get_comments_number();
if ($number > 1) {
$output = str_replace('%', number_format_i18n($number), (false === $more) ? __('% Comments') : $more);
} elseif ($number == 0) {
$output = (false === $zero) ? __('No Comments') : $zero;
} else {
// must be one
$output = (false === $one) ? __('1 Comment') : $one;
}
/**
* Filter the comments count for display.
*
* @since 1.5.0
*
* @see _n()
*
* @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.
*/
echo apply_filters('comments_number', $output, $number);
}