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



esc_attr_e › WordPress Function

Since2.8.0
已弃用n/a
esc_attr_e ( $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'
定义在:
文档:

Displays translated text that has been escaped for safe use in an attribute.

Encodes < > & " ' (less than, greater than, ampersand, double quote, single quote). Will never double encode entities. If you need the value for use in PHP, use esc_attr__().


源码

function esc_attr_e( $text, $domain = 'default' ) {
	echo esc_attr( translate( $text, $domain ) );
}