esc_attr

Definition:
function esc_attr( $text ) {}

Escaping for HTML attributes.

Parameters

  • string $text

Defined filters

  • attribute_escape
    apply_filters( 'attribute_escape', $safe_text, $text )

Source code

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 );

}

1018

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: