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

February 12, 2011 


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