Dev - Allow to filter wc_help_tip output (#37485)

Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
This commit is contained in:
Chris Greys 2023-04-12 16:52:18 +09:00 committed by GitHub
parent a740126564
commit 61da4c6161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Dev - Allow to filter wc_help_tip

View File

@ -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 );
}
/**