Reply To: conflict with imsanity / need way to remove orginals

Bring Your Business to LifeSupportImage Storeconflict with imsanity / need way to remove orginalsReply To: conflict with imsanity / need way to remove orginals

#53448
Xpark Media
Keymaster

@dave,

You can create a plugin to remove the images once they are uploaded, we recently did it for one of our clients, modify it as needed.

function ims_delete_original_image( $metadata, $attachment_id ){
if (empty($metadata['file']) || 'ims_image' != get_post_type($attachment_id) )
return $metadata;
if( file_exists( $metadata['file'] ))
@unlink( $metadata['file'] );
return $metadata;
} add_filter('wp_generate_attachment_metadata','ims_delete_original_image');