Fixed shortcodes formatted with <p> and improved wc_format_content()
This fix the shortcode issue, stop extra sanitization and allow use smilies, attachments, embeds and Jetpack markdown. Closes #14135
This commit is contained in:
parent
702d72f173
commit
5eab267ec1
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue