Gettext_Translations::nplurals_and_expression_from_header( string $header ): array


Parameters

$header string Required

Top ↑

Return

array


Top ↑

Source

File: wp-includes/pomo/translations.php. View all references

public function nplurals_and_expression_from_header( $header ) {
	if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) {
		$nplurals   = (int) $matches[1];
		$expression = trim( $matches[2] );
		return array( $nplurals, $expression );
	} else {
		return array( 2, 'n != 1' );
	}
}


Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.