_n_noop()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
_n_noop( string $singular, string $plural, string $domain = null ): array
Описание
Используется, когда нужно сохранить структуры с переводимыми строками во множественном числе и использовать их позже, когда число станет известно.
Пример:
$message = _n_noop( '%s post', '%s posts', 'text-domain' );
...
printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );
Оригинал (английский)
Used when you want to keep structures with translatable plural strings and use them later when 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 ) );
Параметры
$singular
string
обязательный
$plural
string
обязательный
$domain
string
необязательный
= null
Возвращаемое значение
array
Исходный код
wp-includes/l10n.php:608
function _n_noop( $singular, $plural, $domain = null ) {
return array(
0 => $singular,
1 => $plural,
'singular' => $singular,
'plural' => $plural,
'context' => null,
'domain' => $domain,
);
}
История изменений
| Версия | Описание |
|---|---|
| 2.5.0 | Introduced. |

