wc_sanitize_tooltip()
Sanitize a string destined to be a tooltip.
No Hooks.
Return
String
.
Usage
wc_sanitize_tooltip( $var );
- $var(string) (required)
- Data to sanitize.
Changelog
Since 2.3.10 | Introduced. |
Since 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 code WC 9.6.1
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(), ) ) ); }