WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use the script below in order to disable automatic thumbnail generation when images are uploaded via the media manager.

I'd like to leave the thumbnail option intact when an image is uploaded directly to a post, because that uploader gives the user the ability to specify the image size.

The problem is that it disables thumbnail options in both places. I want to allow thumbs everywhere except the media manager upload.

if ($pagenow == 'media-new.php' || $pagenow == 'async-upload.php'){

function disable_thumbnails($arr_sizes){
    if(!stristr($_POST['type'], 'image')){
        return array();
    return $arr_sizes;
share|improve this question
up vote 1 down vote accepted

Not sure if I've understand this correctly but you should be able to check which tab is currently open by looking at $_GET['tab']

  • upload new tab = type
  • from url = type_url
  • gallery = gallery
  • media library = library

So you could wrap your code inside

if ( $_GET['tab'] != 'type' )  // do stuff
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.