Dev - Allow to filter wc_help_tip output (#37485)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
This commit is contained in:
parent
a740126564
commit
61da4c6161
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Dev - Allow to filter wc_help_tip
|
|
@ -1593,12 +1593,24 @@ function wc_back_link( $label, $url ) {
|
|||
*/
|
||||
function wc_help_tip( $tip, $allow_html = false ) {
|
||||
if ( $allow_html ) {
|
||||
$tip = wc_sanitize_tooltip( $tip );
|
||||
$sanitized_tip = wc_sanitize_tooltip( $tip );
|
||||
} else {
|
||||
$tip = esc_attr( $tip );
|
||||
$sanitized_tip = esc_attr( $tip );
|
||||
}
|
||||
|
||||
return '<span class="woocommerce-help-tip" data-tip="' . $tip . '"></span>';
|
||||
/**
|
||||
* 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" data-tip="' . $sanitized_tip . '"></span>', $sanitized_tip, $tip, $allow_html );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue