From 5eab267ec1df635a2669b305e89e7e2b101edf7a Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 10 Apr 2017 19:21:22 -0300 Subject: [PATCH] Fixed shortcodes formatted with

and improved wc_format_content() This fix the shortcode issue, stop extra sanitization and allow use smilies, attachments, embeds and Jetpack markdown. Closes #14135 --- includes/wc-core-functions.php | 1 + includes/wc-formatting-functions.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index b3a796b55b1..899e0cf012e 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -51,6 +51,7 @@ add_filter( 'woocommerce_short_description', 'wpautop' ); add_filter( 'woocommerce_short_description', 'shortcode_unautop' ); add_filter( 'woocommerce_short_description', 'prepend_attachment' ); add_filter( 'woocommerce_short_description', 'do_shortcode', 11 ); // AFTER wpautop() +add_filter( 'woocommerce_short_description', 'wc_format_product_short_description', 9999999 ); /** * Define a constant if it is not already defined. diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index d094cffbbb6..683325ebf82 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -847,7 +847,7 @@ function wc_trim_string( $string, $chars = 200, $suffix = '...' ) { * @return string */ function wc_format_content( $raw_string ) { - return apply_filters( 'woocommerce_format_content', wpautop( do_shortcode( wp_kses_post( $raw_string ) ) ), $raw_string ); + return apply_filters( 'woocommerce_format_content', apply_filters( 'woocommerce_short_description', $raw_string ), $raw_string ); } /** @@ -869,8 +869,6 @@ function wc_format_product_short_description( $content ) { return $content; } -add_filter( 'woocommerce_short_description', 'wc_format_product_short_description', 9999999 ); - /** * Formats curency symbols when saved in settings. * @param string $value