ngettext_with_context_(domain) filter-hookWP 5.5.0

Filters the singular or plural form of a string with gettext context for a domain.

The dynamic portion of the hook name, $domain, refers to the text domain.

Usage

add_filter( 'ngettext_with_context_(domain)', 'wp_kama_ngettext_with_context_domain_filter', 10, 6 );

/**
 * Function for `ngettext_with_context_(domain)` 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 $context     Context information for the translators.
 * @param string $domain      Text domain. Unique identifier for retrieving translated strings.
 *
 * @return string
 */
function wp_kama_ngettext_with_context_domain_filter( $translation, $single, $plural, $number, $context, $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.
$context(string)
Context information for the translators.
$domain(string)
Text domain. Unique identifier for retrieving translated strings.

Changelog

Since 5.5.0 Introduced.

Where the hook is called

_nx()
ngettext_with_context_(domain)
wp-includes/l10n.php 564
$translation = apply_filters( "ngettext_with_context_{$domain}", $translation, $single, $plural, $number, $context, $domain );

Where the hook is used in WordPress

Usage not found.