Last active
April 6, 2020 08:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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