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.


Top ↑

Parameters

$num

(int)(Required)Number to get plural form for.


Top ↑

Return

(int) Plural form value.


Top ↑

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 ];
		}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

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.