Gettext_Translations::gettext_select_plural_form
The gettext implementation of select_plural_form.
It lives in this class, because there are more than one descendant, which will use it and they can't share it effectively.
Method of the class: Gettext_Translations{}
No Hooks.
Returns
Int. Plural form to use.
Usage
$Gettext_Translations = new Gettext_Translations(); $Gettext_Translations->gettext_select_plural_form( $count );
- $count(int) (required)
- Plural forms count.
Changelog
| Since 2.8.0 | Introduced. |
Gettext_Translations::gettext_select_plural_form() Gettext Translations::gettext select plural form code WP 6.9.1
public function gettext_select_plural_form( $count ) {
if ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) {
list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );
$this->_nplurals = $nplurals;
$this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression );
}
return call_user_func( $this->_gettext_select_plural_form, $count );
}