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:
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
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
- Page :
- 1
There are no replies made for this post yet.