WP_CLI\Utils
pluralize()
Pluralizes a noun in a grammatically correct way.
No Hooks.
Returns
String. Pluralized noun.
Usage
pluralize( $noun, $count );
- $noun(string) (required)
- 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.
Default:null
pluralize() pluralize code WP-CLI 2.13.0-alpha
function pluralize( $noun, $count = null ) {
if ( 1 === $count ) {
return $noun;
}
return Inflector::pluralize( $noun );
}