Last active
April 25, 2022 10:05
-
-
Save Auke1810/f6627c1534781375a072a79a2bde0dff to your computer and use it in GitHub Desktop.
remove all html tags from the description tag
This file contains hidden or 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
<?php | |
function alter_feed_item( $attributes, $feed_id, $product_id ) { | |
// Strip html from description attributes | |
// allow given tags with allowedTags | |
$allowedTags = ""; | |
$attributes['description'] = strip_tags($attributes['description'], $allowedTags); | |
// IMPORTANT! Always return the $attributes | |
return $attributes; | |
} | |
add_filter( 'wppfm_feed_item_value', 'alter_feed_item', 10, 3 ); |
I am using WP with WooCommerce, all what I need is to delete those HTML tags on my product descriptions. I don't think I need to download and install that plugin!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, this function is a WordPress filter for our Product feed manager plugin.
There is no other use for this little snippet as for our feed manager you find at https://www.wpmarketingrobot.com/