How to change the image size in new Media Uploader (ie use medium vs thumbnail)

Supposing that I’m interpreting your Question correctly

The thumbnails displayed in the new Media Uploader are already the medium sized ones, being constrained on the fly.

media uploader inspector

So, it’s a matter of applying some CSS styling to increase their size. Maybe other style adjustments are necessary, this is just a proof of concept.

add_action( 'admin_head-post-new.php', 'style_thumbnails_wpse_81677' );
add_action( 'admin_head-post.php', 'style_thumbnails_wpse_81677' );

function style_thumbnails_wpse_81677()
{
    $thumb_width  = get_option( 'medium_size_w' );
    $thumb_height = get_option( 'medium_size_h' );

    echo "
    <style type="text/css">
        .details.attachment, .attachement, .attachment.save-ready {
            width:{$thumb_width}px !important;
        }
        .attachment-preview, .attachment-preview .thumbnail {
            width: {$thumb_width}px !important;
            height: {$thumb_height}px !important;
        }
        .portrait .thumbnail img, .landscape .thumbnail img {
            max-width: {$thumb_width}px !important;
            max-height: {$thumb_height}px !important;
        }
    </style>
    ";
}

Result:

bigger thumbs in new media uploader

Leave a Comment