esc_html_x

函式
esc_html_x ( $text, $context, $domain = 'default' )
引數
  • (string) $text Text to translate.
    Required:
  • (string) $context Context information for the translators.
    Required:
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.
    Required:
    Default: 'default'
返回值
  • (string) Translated text.
定義位置
相關方法
esc_html_eesc_html__esc_htmlesc_xmlesc_attr_x
引入
2.9.0
棄用
-

esc_html_x: 這個函式與esc_html_e類似,但用於翻譯有特定上下文的字串。

用gettext上下文翻譯字串,並將其轉義以便在HTML輸出中安全使用。

如果沒有翻譯,或者沒有載入文字域,則轉義為原始文字並返回。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function esc_html_x( $text, $context, $domain = 'default' ) {
return esc_html( translate_with_gettext_context( $text, $context, $domain ) );
}
function esc_html_x( $text, $context, $domain = 'default' ) { return esc_html( translate_with_gettext_context( $text, $context, $domain ) ); }
function esc_html_x( $text, $context, $domain = 'default' ) {
	return esc_html( translate_with_gettext_context( $text, $context, $domain ) );
}

常見問題

FAQs
檢視更多 >