attribute_escape хук-фильтрWP 2.0.6

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.

Использование

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

/**
 * Function for `attribute_escape` filter-hook.
 * 
 * @param string $safe_text The text after it has been escaped.
 * @param string $text      The text prior to being escaped.
 *
 * @return string
 */
function wp_kama_attribute_escape_filter( $safe_text, $text ){

	// filter...
	return $safe_text;
}
$safe_text(строка)
The text after it has been escaped.
$text(строка)
The text prior to being escaped.

Список изменений

С версии 2.0.6 Введена.

Где вызывается хук

esc_attr()
attribute_escape
wp-includes/formatting.php 4720
return apply_filters( 'attribute_escape', $safe_text, $text );

Где используется хук в WordPress

Использование не найдено.