函数原型
esc_attr__( string $text, string $domain = ‘default’ ): string
函数描述
Retrieves the translation of $text and escapes it for safe use in an attribute.
是否弃用
未弃用
函数参数
-
$text
string
Required - Text to translate.
-
$domain
string
Optional - Text domain. Unique identifier for retrieving translated strings.
Default'default'.Default:
'default'
函数返回值
string Translated text on success, original text on failure.
函数位置
File: wp-includes/l10n.php.
函数源码
function esc_attr__( $text, $domain = 'default' ) {
return esc_attr( translate( $text, $domain ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |

