Filters the singular or plural form of a string.
Filtre la forme singulière ou plurielle d'une chaîne de caractères.
$translation, $single, $plural, $number, $domain
Sortie :
@param string $translation Translated text. @param string $single The text to be used if the number is singular. @param string $plural The text to be used if the number is plural. @param int $number The number to compare against to use either the singular or plural form. @param string $domain Text domain. Unique identifier for retrieving translated strings.
add_filter('ngettext', 'custom_plural_translation', 10, 5);
function custom_plural_translation($trans, $single, $plural, $num, $domain) {
if ($domain === 'my-plugin' && $num === 0) return 'No items';
return $trans;
}
Chargement des actualités...