Created
February 26, 2026 08:15
-
-
Save pirate-bot/e62dd80bfd27c09d464240f9e242e0a4 to your computer and use it in GitHub Desktop.
Do not import items that do not have images.
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 tweak - Do not import items that do not have images | |
| Version: 0.0.1 | |
| Author URI: https://themeisle.com | |
| */ | |
| add_filter( 'feedzy_insert_post_args', 'feedzy_insert_post_limit', 10, 4 ); | |
| function feedzy_insert_post_limit( $args, $item, $title, $content ) { | |
| // empty title and content prevents WP from inserting a post. | |
| $allowed = array('gif', 'png', 'jpg', 'jpeg'); | |
| $filename = $item['item_img_path']; | |
| $ext = pathinfo($filename, PATHINFO_EXTENSION); | |
| if (!in_array($ext, $allowed)) { | |
| $args['post_title'] = ''; | |
| $args['post_content'] = ''; | |
| } | |
| return $args; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment