wc_sanitize_tooltip() WC 2.3.10
Sanitize a string destined to be a tooltip.
Хуков нет.
Возвращает
Строку.
Использование
wc_sanitize_tooltip( $var );
- $var(строка) (обязательный)
- Data to sanitize.
Список изменений
С версии 2.3.10 | Введена. |
С версии 2.3.10 | Tooltips are encoded with htmlspecialchars to prevent XSS. Should not be used in conjunction with esc_attr() |
Код wc_sanitize_tooltip() wc sanitize tooltip WC 5.0.0
function wc_sanitize_tooltip( $var ) {
return htmlspecialchars(
wp_kses(
html_entity_decode( $var ),
array(
'br' => array(),
'em' => array(),
'strong' => array(),
'small' => array(),
'span' => array(),
'ul' => array(),
'li' => array(),
'ol' => array(),
'p' => array(),
)
)
);
}