Translations::select_plural_form()publicWP 2.8.0

Given the number of items, returns the 0-based index of the plural form to use

Here, in the base Translations class, the common logic for English is implemented:
0 if there is one element, 1 otherwise

This function should be overridden by the subclasses. For example MO/PO can derive the logic from their headers.

Метод класса: Translations{}

Хуков нет.


int. Plural form to use.


$Translations = new Translations();
$Translations->select_plural_form( $count );
$count(int) (обязательный)
Number of items.

Список изменений

С версии 2.8.0 Введена.

Код Translations::select_plural_form() WP 6.6

public function select_plural_form( $count ) {
	return 1 === (int) $count ? 0 : 1;