diff --git a/plugins/woocommerce/changelog/fix-36543 b/plugins/woocommerce/changelog/fix-36543 new file mode 100644 index 00000000000..483efbe86c4 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36543 @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Dev - Allow to filter wc_help_tip diff --git a/plugins/woocommerce/includes/wc-core-functions.php b/plugins/woocommerce/includes/wc-core-functions.php index 68d88a6ec12..9c1d0a57248 100644 --- a/plugins/woocommerce/includes/wc-core-functions.php +++ b/plugins/woocommerce/includes/wc-core-functions.php @@ -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 ''; + /** + * 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', '', $sanitized_tip, $tip, $allow_html ); } /**