Created
February 26, 2026 08:15
-
-
Save pirate-bot/52bd754935dfa3484eb1c611bf252188 to your computer and use it in GitHub Desktop.
Remove all the links from the content when importing posts in Feedzy.
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 | |
| /* | |
| Plugin Name: Feedzy plugin to remove all the links from the imported content | |
| Version: 0.0.1 | |
| Author URI: https://themeisle.com | |
| */ | |
| function bweb_feedzy_remove_link_matches( $matches ) { | |
| return $matches[2]; | |
| } | |
| add_filter('feedzy_insert_post_args', 'feedzy_insert_post_args', 10, 4); | |
| function feedzy_insert_post_args( $args, $item, $post_title, $post_content ) { | |
| $pattern= '/<a.*href=\"(https?:\/\/.*)\".*>(.*)<\/a>/iU'; | |
| $args['post_content'] = preg_replace_callback( $pattern, 'bweb_feedzy_remove_link_matches', $post_content ); | |
| return $args; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment