Home/Hooks/attribute_escape
FILTER

attribute_escape

Filters a string cleaned and escaped for output in an HTML attribute. Text passed to esc_attr() is stripped of invalid or special characters before output.

wp-includes/formatting.php
Line 4712
2 Parameters
View Source

Usage

add_filter( 'attribute_escape', 'your_callback_function', 10, 2 );

Filter Callback:

function your_callback_function( $safe_text, $text ) {
    // Your code here
    return $safe_text;
}

Parameters

$safe_text

Parameter 1

$text

Parameter 2

🔄 Filter Hook

Filter hooks allow you to modify data before it is saved to the database or displayed on the screen. Filters must return a value.