diff --git a/includes/api/class-wc-api-products.php b/includes/api/class-wc-api-products.php index ec49ce0439c..df0d61cb0d9 100644 --- a/includes/api/class-wc-api-products.php +++ b/includes/api/class-wc-api-products.php @@ -306,7 +306,7 @@ class WC_API_Products extends WC_API_Resource { 'shipping_taxable' => $product->is_shipping_taxable(), 'shipping_class' => $product->get_shipping_class(), 'shipping_class_id' => ( 0 !== $product->get_shipping_class_id() ) ? $product->get_shipping_class_id() : null, - 'description' => apply_filters( 'the_content', $product->get_post_data()->post_content ), + 'description' => wpautop( do_shortcode( $product->get_post_data()->post_content ) ), 'short_description' => apply_filters( 'woocommerce_short_description', $product->get_post_data()->post_excerpt ), 'reviews_allowed' => ( 'open' === $product->get_post_data()->comment_status ), 'average_rating' => wc_format_decimal( $product->get_average_rating(), 2 ), @@ -323,7 +323,7 @@ class WC_API_Products extends WC_API_Resource { 'download_limit' => (int) $product->download_limit, 'download_expiry' => (int) $product->download_expiry, 'download_type' => $product->download_type, - 'purchase_note' => apply_filters( 'the_content', $product->purchase_note ), + 'purchase_note' => wpautop( do_shortcode( $product->purchase_note ) ), 'total_sales' => metadata_exists( 'post', $product->id, 'total_sales' ) ? (int) get_post_meta( $product->id, 'total_sales', true ) : 0, 'variations' => array(), 'parent' => array(), diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index e4ff00fcf72..81e2b3eacc7 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -471,7 +471,7 @@ if ( ! function_exists( 'woocommerce_taxonomy_archive_description' ) ) { */ function woocommerce_taxonomy_archive_description() { if ( is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) == 0 ) { - $description = apply_filters( 'the_content', term_description() ); + $description = wpautop( do_shortcode( term_description() ) ); if ( $description ) { echo '
' . $description . '
'; } @@ -491,7 +491,7 @@ if ( ! function_exists( 'woocommerce_product_archive_description' ) ) { if ( is_post_type_archive( 'product' ) && get_query_var( 'paged' ) == 0 ) { $shop_page = get_post( wc_get_page_id( 'shop' ) ); if ( $shop_page ) { - $description = apply_filters( 'the_content', $shop_page->post_content ); + $description = wpautop( do_shortcode( $shop_page->post_content ) ); if ( $description ) { echo '
' . $description . '
'; } @@ -890,9 +890,9 @@ if ( ! function_exists( 'woocommerce_quantity_input' ) ) { /** * Output the quantity input for add to cart forms. - * + * * @param array $args Args for the input - * @param WC_Product|null $product + * @param WC_Product|null $product * @param boolean $echo Whether to return or echo * @return void|string */ @@ -1015,7 +1015,7 @@ if ( ! function_exists( 'woocommerce_sort_product_tabs' ) ) { * @return array */ function woocommerce_sort_product_tabs( $tabs = array() ) { - + // Make sure the $tabs parameter is an array if ( ! is_array( $tabs ) ) { trigger_error( "Function woocommerce_sort_product_tabs() expects an array as the first parameter. Defaulting to empty array." ); @@ -1574,7 +1574,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) { * @param mixed $args * @param string $value (default: null) * @return void - * @todo This function needs to be broken up in smaller pieces + * @todo This function needs to be broken up in smaller pieces */ function woocommerce_form_field( $key, $args, $value = null ) { $defaults = array( @@ -1796,7 +1796,7 @@ if ( ! function_exists( 'get_product_search_form' ) ) { * @subpackage Forms * @param bool $echo (default: true) * @return string - * @todo This function needs to be broken up in smaller pieces + * @todo This function needs to be broken up in smaller pieces */ function get_product_search_form( $echo = true ) { do_action( 'get_product_search_form' ); diff --git a/templates/emails/email-order-items.php b/templates/emails/email-order-items.php index b05f66a09ad..1dfd706eaee 100644 --- a/templates/emails/email-order-items.php +++ b/templates/emails/email-order-items.php @@ -64,7 +64,7 @@ foreach ( $items as $item ) : id, '_purchase_note', true ) ) : ?> - + diff --git a/templates/order/order-details.php b/templates/order/order-details.php index b5544a5b1e2..85c87d1661e 100755 --- a/templates/order/order-details.php +++ b/templates/order/order-details.php @@ -79,7 +79,7 @@ $order = new WC_Order( $order_id ); if ( in_array( $order->status, array( 'processing', 'completed' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) { ?> - +