ngettext_(domain) хук-фильтрWP 5.5.0

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

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

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

add_filter( 'ngettext_(domain)', 'wp_kama_ngettext_domain_filter', 10, 5 );

/**
 * Function for `ngettext_(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 $domain      Text domain. Unique identifier for retrieving translated strings.
 *
 * @return string
 */
function wp_kama_ngettext_domain_filter( $translation, $single, $plural, $number, $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(строка)
The number to compare against to use either the singular or plural form.
$domain(строка)
Text domain. Unique identifier for retrieving translated strings.

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

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

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

_n()
ngettext_(domain)
wp-includes/l10n.php 503
$translation = apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain );

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

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