ngettext_{$domain}

過濾鉤子
apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain )
引數
  • (string) $translation Translated text.
    Required:
  • (string) $single The text to be used if the number is singular.
    Required:
  • (string) $plural The text to be used if the number is plural.
    Required:
  • (int) $number The number to compare against to use either the singular or plural form.
    Required:
  • (string) $domain Text domain. Unique identifier for retrieving translated strings.
    Required:
定義位置
相關勾子
gettext_domainngettextunload_textdomainload_textdomainngettext_with_context_domain
相關方法
unload_textdomain__ngettext_noopload_textdomainget_next_image_link__ngettextload_default_textdomain
引入
5.5.0
棄用
-

ngettext_{$domain}與ngettext函式類似,但它還需要一個額外的引數$domain,即應該用於翻譯的文字域。一個文字域是一組翻譯的唯一識別符號,通常與一個外掛或主題相關。

為域過濾字串的單數或複數形式。

鉤子名稱的動態部分$domain引用文字域。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$translation = apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain );
$translation = apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain );
$translation = apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain );

常見問題

FAQs
檢視更多 >