WP_CLI\Utils
pluralize()
Pluralizes a noun in a grammatically correct way.
Хуков нет.
Возвращает
Строку. Pluralized noun.
Использование
pluralize( $noun, $count );
- $noun(строка) (обязательный)
- Noun to be pluralized. Needs to be in singular form.
- $count(int|null)
- Count of the nouns, to decide whether to pluralize. Will pluralize unconditionally if none provided.
По умолчанию:null
Код pluralize() pluralize WP-CLI 2.13.0-alpha
function pluralize( $noun, $count = null ) {
if ( 1 === $count ) {
return $noun;
}
return Inflector::pluralize( $noun );
}