Plural_Forms::get() WordPress Method
The Plural_Forms::get() method is used to retrieve the plural forms for a given word in a given language. This is useful when translating words into different languages, as the plural forms of words can vary widely between languages. The Plural_Forms::get() method takes two parameters: the word to be pluralized, and the desired language. It returns an array of plural forms for the word in the given language.
Plural_Forms::get( int $num ) #
Get the plural form for a number.
Description
Caches the value for repeated calls.
Parameters
- $num
(int)(Required)Number to get plural form for.
Return
(int) Plural form value.
Source
File: wp-includes/pomo/plural-forms.php
public function get( $num ) {
if ( isset( $this->cache[ $num ] ) ) {
return $this->cache[ $num ];
}
$this->cache[ $num ] = $this->execute( $num );
return $this->cache[ $num ];
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |