I want to wrap the filter below in a conditional that tests whether the user is uploading an image from the Media Manager (Admin > Media > Add New) and not from the post editor image upload routine.
Is it possible to tell? $pagenow in both cases appears to be the same...
//no extra thumbs
global $pagenow;
if($pagenow=="media-new.php"){
add_filter('intermediate_image_sizes_advanced','ce4_no_thumbs');
}
function ce4_no_thumbs($sizes){return array();}
Update: It does appear that there is a post_id on the querystring when upload is accessed from within a post and not when it is accessed via "media manager > add new", however, the following test passes in either case...
if ( is_admin() && !isset($_GET['post_id']) ) {
/*This should not fire if user is uploading an image into a post,
since post_id is on the querystring. However, in my test
its still getting through.*/
add_filter('intermediate_image_sizes_advanced','ce4_no_thumbs');
}