[This code works][1] for me if I go to upload a file and choose the **Gallery** or **Media Library** tabs then it correctly hides elements on the page.

If I go to the **From Computer** or **From URL** tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

**Gallery tab** works:
/wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

**From Computer** tab doesn't work:
/wp-admin/media-upload.php?post_id=4&type=image&tab=type

Any ideas?

  [1]: http://wordpress.stackexchange.com/questions/51546/how-to-removing-fields-from-the-media-uploader-gallery-on-a-custom-post-type-edi