WP_CLI\Utils

pluralize()WP-CLI 1.0

Pluralizes a noun in a grammatically correct way.

No Hooks.

Return

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

Code of pluralize() WP-CLI 2.7.0-alpha

function pluralize( $noun, $count = null ) {
	if ( 1 === $count ) {
		return $noun;
	}

	return Inflector::pluralize( $noun );
}