_n

Definition:
function _n( $single, $plural, $number, $domain = 'default' ) {}

Retrieve the plural or single form based on the amount.
If the domain is not set in the $l10n list, then a comparison will be made and either $plural or $single parameters returned.

Parameters

  • string $single: The text that will be used if $number is 1
  • string $plural: The text that will be used if $number is not 1
  • int $number: The number to compare against to use either $single or $plural
  • string $domain: Optional. The domain identifier the text should be retrieved in

Return values

returns:Either $single or $plural translated text

Defined filters

  • ngettext
    apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain )

Source code

function _n( $single, $plural, $number, $domain = 'default' ) {

	$translations = &get_translations_for_domain( $domain );

	$translation = $translations->translate_plural( $single, $plural, $number );

	return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );

}

4341

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: