Escaping for HTML attributes.
Signature
esc_attr( $text )
- text
- (string)
Return
(string)
Source
function esc_attr( $text ) {
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
return apply_filters( 'attribute_escape', $safe_text, $text );
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/esc_attr/ -
HTML
<a href='http://queryposts.com/function/esc_attr/'>esc_attr()</a> -
Markdown
[esc_attr()](http://queryposts.com/function/esc_attr/) -
BBCode
[url=http://queryposts.com/function/esc_attr/]esc_attr()[/url]