Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active April 6, 2020 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Auke1810/4f6a79ade01d7ecc6d10d010dc5be860 to your computer and use it in GitHub Desktop.
Save Auke1810/4f6a79ade01d7ecc6d10d010dc5be860 to your computer and use it in GitHub Desktop.
use the original description without stripping away all the line breaks and paragraph tags from the description field.
// use the original description without stripping away all the line breaks and paragraph tags from the description field.
function use_original_description( $data, $feed_id, $product_id ) {
// Only use the original description in the feed with the given ID (in this case 2)
// remove if you want this for all feeds.
if($feed_id == 2 ){
// Get the product.
$wc_product = wc_get_product( $product_id );
// Store the original description in the feed description element.
$data['description'] = $wc_product->get_description();
} //END IF
// Always return data!
return $data;
}
add_filter( 'wppfm_feed_item_value', 'use_original_description', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment