This page redirects to an external site: https://developer.wordpress.org/reference/functions/attribute_escape/
← Return to function reference.
This function is deprecated as of WordPress 2.8.0. Please use esc_attr instead.
This function escapes or encodes HTML special characters (including single and double quotes) for use in HTML attributes. It works like the standard PHP htmlspecialchars except that it doesn't double-encode HTML entities (i.e. & will remain unchanged, rather than encoded to &).
attribute_escape can be found in /wp-includes/formatting.php.
<?php echo attribute_escape($text); ?>
$text