WordPress开发者和主题制作者的搜索引擎



esc_attr__ ›

Since2.8.0
已弃用n/a
esc_attr__ ( $text, $domain = 'default' )
参数: (2)
  • (string) $text Text to translate.
    Required: Yes
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.
    Required: No
    默认: 'default'
返回:
  • (string) Translated text on success, original text on failure.
定义在:
文档:

Retrieve the translation of $text and escapes it for safe use in an attribute.

If there is no translation, or the text domain isn't loaded, the original text is returned.



源码

function esc_attr__( $text, $domain = 'default' ) {
	return esc_attr( translate( $text, $domain ) );
}