Gettext_Translations::gettext_select_plural_form() WordPress Method

The Gettext_Translations::gettext_select_plural_form() WordPress method is used to select the appropriate form of a string based on the number it represents.

Gettext_Translations::gettext_select_plural_form( int $count ) #

The gettext implementation of select_plural_form.


Description

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


Top ↑

Parameters

$count

(int)(Required)


Top ↑

Source

File: wp-includes/pomo/translations.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 );
		}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.