Friday, June 04 2021
  1 Replies
  386 Visits
  Subscribe
Hi together,

I want to remove the original file after uploading. Same issue as here:

Link: Forum Link

While searching for a solution I found a function to filter/hook in into the process:


add_filter( 'wp_generate_attachment_metadata', 'delete_fullsize_image' );
function delete_fullsize_image( $metadata )
{
$upload_dir = wp_upload_dir();
$full_image_path = trailingslashit( $upload_dir['basedir'] ) . $metadata['file'];
$deleted = unlink( $full_image_path );

return $metadata;

}


Link: stackoverflow

This doesn´t work for me (code placed in functions.php). I founded calls to the filter many times in the plugin-files.

Can you please give me a fast solution for deleting the original files, which even works for upcoming updates for your plugin?

Kind regards

Franz
A
more than a month ago
Hi,

Thanks for contacting us here about this extension.

Can you please give me a fast solution for deleting the original files, which even works for upcoming updates for your plugin?


Sorry, here is the pre-sales forum, for all technical issues, please drop us a ticket (Menu Support > Support ticket).
Our developer in charge will take a look at that.


Thanks a lot!
Cheers,
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!