Merge pull request #4763 from claudiosmweb/remove_the_content_filter

Removed all the_content filter in favor to wpautop() and do_shortcode()
This commit is contained in:
Mike Jolley 2014-05-15 10:52:26 +01:00
commit b7643e469b
4 changed files with 11 additions and 11 deletions

View File

@ -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(),

View File

@ -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 '<div class="term-description">' . $description . '</div>';
}
@ -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 '<div class="page-description">' . $description . '</div>';
}

View File

@ -64,7 +64,7 @@ foreach ( $items as $item ) :
<?php if ( $show_purchase_note && is_object( $_product ) && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) : ?>
<tr>
<td colspan="3" style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo apply_filters( 'the_content', $purchase_note ); ?></td>
<td colspan="3" style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo wpautop( do_shortcode( $purchase_note ) ); ?></td>
</tr>
<?php endif; ?>

View File

@ -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 ) ) ) {
?>
<tr class="product-purchase-note">
<td colspan="3"><?php echo apply_filters( 'the_content', $purchase_note ); ?></td>
<td colspan="3"><?php echo wpautop( do_shortcode( $purchase_note ) ); ?></td>
</tr>
<?php
}