WPDev.one

_n()

_n( mixed $single, mixed $plural, mixed $number, mixed $domain = 'default' )

Translates and retrieves the singular or plural form based on the supplied number.

Parameters 4 required

Name / Type Description
$single
string

The text to be used if the number is singular.

Required
$plural
string

The text to be used if the number is plural.

Required
$number
int

The number to compare against to use either the singular or plural form.

Required
string

$domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.

Required

Return Value

(string)
The translated singular or plural form.

Function Information

Since Version
2.8.0
Source File
wp-includes/l10n.php
Advertisement