José Luís
Member
Posted 1 year ago #
It's somewhat well-known how to add custom media sizes by using:
add_image_size( HANDLE, WIDTH, HEIGHT, CROP );
But, how to remove them? I've added a "tiny" 50x50 size and now my post-thumbnail-meta-box uses it to show the thumbnail. I only could override this by setting default thumbnail again with:
set_post_thumbnail_size(get_option('thumbnail_size_w'), get_option('thumbnail_size_h'), get_option('thumbnail_crop'));
Can somebody help me?
José Luís
Member
Posted 1 year ago #
With WordPress 3.0 out, are there any news on this subject?
I can't find anything to specifically remove custom images sizes but you could try pulling them out of the $_wp_additional_image_sizes array :
wp-includes/media.php:
function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) {
global $_wp_additional_image_sizes;
$_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop );
}