The Stack Overflow podcast is back! Listen to an interview with our new CEO.
    Tweeted twitter.com/#!/StackWordPress/status/459913958947057664
2 edited title
| link

Wordpress media library not showing thumbnails after deleting full image

1
source | link

Wordpress media library not showing thumbnails after deleting full image

I am using a bit of code, that deletes the unneccessary full images after uploading and adding different sizes.

deleting function in functions.php:

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;
}

So, that works great, but the problem is I can not see any thumbnails in the media library anymore as they are generated by the full size image only, it seems. This makes it really complicated/hard to work with the uploaded images.

Is it somehow possible to "repair" this and and get those little thumbnails in the media library from another size (like medium, large or any custom named size)?

Thank you in advance, guys.