NOOP_Translations::select_plural_form() WordPress Method

The NOOP_Translations::select_plural_form() WordPress method is used to select the appropriate form of a plural string, based on the number of items. This method is used when the number of items is known and the correct form of the plural string needs to be selected. For example, if the string is "There are %d comments", and the number of comments is 1, the string "There is 1 comment" would be returned. If the number of comments is 2, the string "There are 2 comments" would be returned. This method is part of the WordPress Translation API and is used by the WordPress core to translate strings.

NOOP_Translations::select_plural_form( int $count ) #


Parameters

$count

(int)(Required)


Top ↑

Return

(bool)


Top ↑

Source

File: wp-includes/pomo/translations.php

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

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.