wc_help_tip()WC 2.5.0

Display a WooCommerce help tip.

Hooks from the function

Return

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() code WC 8.9.0

function wc_help_tip( $tip, $allow_html = false ) {
	if ( $allow_html ) {
		$sanitized_tip = wc_sanitize_tooltip( $tip );
	} else {
		$sanitized_tip = esc_attr( $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="' . $sanitized_tip . '" data-tip="' . $sanitized_tip . '"></span>', $sanitized_tip, $tip, $allow_html );
}