Translates and returns the singular or plural form of a string that's been registered with _n_noop() or _nx_noop().
Description
Used when you want to use a translatable plural string once the number is known. Example: $message = _n_noop( '%s post', '%s posts', 'text-domain' );
...
printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );
Parameters
$nooped_pluralarray
Array that is usually a return value from _n_noop() or _nx_noop().
$singularstring
Singular form to be localized.
$pluralstring
Plural form to be localized.
$contextstring|null
Context information for the translators.
$domainstring|null
Text domain.
$countint
Number of objects.
$domainstringoptional
Text domain. Unique identifier for retrieving translated strings. If $nooped_plural contains a text domain passed to _n_noop() or _nx_noop(), it will override this value. Default 'default'.Default: 'default'
Return
string
Either $singular or $plural translated text.
Uses · 2
_nx()Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
_n()Translates and retrieves the singular or plural form based on the supplied number.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/l10n.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.