ngettext filter-hookWP 2.2.0

Filters the singular or plural form of a string.

Usage

add_filter( 'ngettext', 'wp_kama_ngettext_filter', 10, 5 );

/**
 * Function for `ngettext` filter-hook.
 * 
 * @param string $translation Translated text.
 * @param string $single      The text to be used if the number is singular.
 * @param string $plural      The text to be used if the number is plural.
 * @param string $number      The number to compare against to use either the singular or plural form.
 * @param string $domain      Text domain. Unique identifier for retrieving translated strings.
 *
 * @return string
 */
function wp_kama_ngettext_filter( $translation, $single, $plural, $number, $domain ){

	// filter...
	return $translation;
}
$translation(string)
Translated text.
$single(string)
The text to be used if the number is singular.
$plural(string)
The text to be used if the number is plural.
$number(string)
The number to compare against to use either the singular or plural form.
$domain(string)
Text domain. Unique identifier for retrieving translated strings.

Changelog

Since 2.2.0 Introduced.

Where the hook is called

_n()
ngettext
wp-includes/l10n.php 488
$translation = apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );

Where the hook is used in WordPress

Usage not found.