wc_sanitize_tooltip

Sanitize a string destined to be a tooltip.

Description

(string) wc_sanitize_tooltip( (string) $var ); 

Returns (string)

Parameters (1)

0. $var (string)
The var.

Usage

  1. if ( !function_exists( 'wc_sanitize_tooltip' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; 
  3.  
  4. // The var. 
  5. $var = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_sanitize_tooltip($var); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. function wc_sanitize_tooltip( $var ) { 
  2. return htmlspecialchars( wp_kses( html_entity_decode( $var ), array( 
  3. 'br' => array(),  
  4. 'em' => array(),  
  5. 'strong' => array(),  
  6. 'small' => array(),  
  7. 'span' => array(),  
  8. 'ul' => array(),  
  9. 'li' => array(),  
  10. 'ol' => array(),  
  11. 'p' => array(),  
  12. ) ) );