apply_filters( 'attribute_escape', string $safe_text, string $text )
- Since
- 2.0.6
Filters a string cleaned and escaped for output in an HTML attribute.
Description
Text passed to esc_attr() is stripped of invalid or special characters before output.
Compatibility
- WordPress
- since 2.0.6
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$safe_textstring- The text after it has been escaped.
$textstring- The text prior to being escaped.
Where this hook fires · 1
wp-includes/formatting.php:4728esc_attr()
Source code
* * @since 2.0.6 * * @param string $safe_text The text after it has been escaped. * @param string $text The text prior to being escaped. */ return apply_filters( 'attribute_escape', $safe_text, $text );} /** * Escaping for textarea values. * * @since 3.1.0Changelog
Introduced in 2.0.6. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.