Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_n [ WordPress Function ]

_n ( $single, $plural, $number, $domain = 'default' )
Parameters:
  • (string) $single The text that will be used if $number is 1
  • (string) $plural The text that will be used if $number is not 1
  • (int) $number The number to compare against to use either $single or $plural
  • (string) $domain Optional. The domain identifier the text should be retrieved in
Uses:
Returns:
  • (string) Either $single or $plural translated text
Defined at:

Benzer Fonksiyonlar: _nc, _nx, _, _x, _e


Retrieve the plural or single form based on the amount.

If the domain is not set in the $l10n list, then a comparison will be made and either $plural or $single parameters returned.

If the domain does exist, then the parameters $single, $plural, and $number will first be passed to the domain's ngettext method. Then it will be passed to the 'ngettext' filter hook along with the same parameters. The expected type will be a string.

Source


<?php
function _n$single$plural$number$domain 'default' ) {
    
$translations = &get_translations_for_domain$domain );
    
$translation $translations->translate_plural$single$plural$number );
    return 
apply_filters'ngettext'$translation$single$plural$number$domain );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics