ngettext_with_context_(domain) хук-фильтрWP 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.

Использование

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 int    $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(строка)
Translated text.
$single(строка)
The text to be used if the number is singular.
$plural(строка)
The text to be used if the number is plural.
$number(int)
The number to compare against to use either the singular or plural form.
$context(строка)
Context information for the translators.
$domain(строка)
Text domain. Unique identifier for retrieving translated strings.

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.