Created
February 14, 2019 15:14
-
-
Save Auke1810/827256dfbea142fbed119b892f463d10 to your computer and use it in GitHub Desktop.
Remove multiple characters from feed
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
| /** | |
| * Alter Product feed item | |
| * remove multiple characters from attribute | |
| */ | |
| function alter_feed_description_attribute( $attributes, $feed_id, $product_id ) { | |
| global $product; | |
| // Remove multiple characters from attribute | |
| $remove = [",", ":", ";"]; | |
| $attributes['description'] = str_replace($remove, '', $attributes['description']); | |
| // IMPORTANT! Always return the $attributes | |
| return $attributes; | |
| } | |
| add_filter( 'wppfm_feed_item_value', 'alter_feed_description_attribute', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment