wc_help_tip()
Display a WooCommerce help tip.
Hooks from the function
Returns
String.
Usage
wc_help_tip( $tip, $allow_html );
- $tip(string) (required)
- Help tip text.
- $allow_html(true|false)
- Allow sanitized HTML if true or escape.
Default: false
Changelog
| Since 2.5.0 | Introduced. |
wc_help_tip() wc help tip code WC 10.4.3
function wc_help_tip( $tip, $allow_html = false ) {
if ( $allow_html ) {
$sanitized_tip = wc_sanitize_tooltip( $tip );
} else {
$sanitized_tip = esc_attr( $tip );
}
$aria_label = wp_strip_all_tags( $tip );
/**
* Filter the help tip.
*
* @since 7.7.0
*
* @param string $tip_html Help tip HTML.
* @param string $sanitized_tip Sanitized help tip text.
* @param string $tip Original help tip text.
* @param bool $allow_html Allow sanitized HTML if true or escape.
*
* @return string
*/
return apply_filters( 'wc_help_tip', '<span class="woocommerce-help-tip" tabindex="0" aria-label="' . esc_attr( $aria_label ) . '" data-tip="' . $sanitized_tip . '"></span>', $sanitized_tip, $tip, $allow_html );
}