Title: Gettext_Translations::gettext_select_plural_form
Published: April 25, 2014
Last modified: August 20, 2026

---

# Gettext_Translations::gettext_select_plural_form( int $count ): int

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#wp--skip-link--target)

The gettext implementation of select_plural_form.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#description)󠁿

It lives in this class, because there are more than one descendant, which will use
it and they can’t share it effectively.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#parameters)󠁿

 `$count`intrequired

Plural forms count.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#return)󠁿

 int Plural form to use.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#source)󠁿

    ```php
    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 );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pomo/translations.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/pomo/translations.php#L285)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/pomo/translations.php#L285-L292)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#related)󠁿

| Uses | Description | 
| [Gettext_Translations::nplurals_and_expression_from_header()](https://developer.wordpress.org/reference/classes/gettext_translations/nplurals_and_expression_from_header/)`wp-includes/pomo/translations.php` |

Returns the nplurals and plural forms expression from the Plural-Forms header.

  | 
| [Gettext_Translations::make_plural_form_function()](https://developer.wordpress.org/reference/classes/gettext_translations/make_plural_form_function/)`wp-includes/pomo/translations.php` |

Makes a function, which will return the right translation index, according to the plural forms header.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/gettext_translations/gettext_select_plural_form/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fgettext_translations%2Fgettext_select_plural_form%2F)
before being able to contribute a note or feedback.