Advertisements

comments_number

Definition:
function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {}

Display the language string for the number of comments the current post has.

Parameters

  • string $zero: Text for no comments
  • string $one: Text for one comment
  • string $more: Text for more than one comment
  • string $deprecated: Not used.

Defined filters

  • comments_number
    apply_filters('comments_number', $output, $number)

Source code

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;



	echo apply_filters('comments_number', $output, $number);

}

647

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: