wc_help_tip

Display a WooCommerce help tip.

Description

(string) wc_help_tip( (string) $tip, (bool) $allow_html = false ); 

Returns (string)

Parameters (2)

0. $tip (string)
Help tip text
1. $allow_html — Optional. (bool) => false
Allow sanitized HTML if true or escape

Usage

  1. if ( !function_exists( 'wc_help_tip' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // Help tip text 
  5. $tip = ''; 
  6.  
  7. // Allow sanitized HTML if true or escape 
  8. $allow_html = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_help_tip($tip, $allow_html); 
  12.  

Defined (1)

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

/includes/wc-core-functions.php  
  1. function wc_help_tip( $tip, $allow_html = false ) { 
  2. if ( $allow_html ) { 
  3. $tip = wc_sanitize_tooltip( $tip ); 
  4. } else { 
  5. $tip = esc_attr( $tip ); 
  6.  
  7. return '<span class="woocommerce-help-tip" data-tip="' . $tip . '"></span>';