I made a plugin which uses the WP media-uploader. I like to store the images in a custom folder only for the plugin image uploads. But adding the filter only for my custom plugin doesn't work

if (($_GET['page']=="add_contender") {
add_filter('intermediate_image_sizes', 'wpse_101197_image_sizes');
function wpse_101197_image_sizes($sizes) {
    /*which images to use in plugin*/
    $sizes = array('thumbnail','logo-contender');
    return $sizes;

I am using the media-upload in a thickbox modalbox could this be the problem as the variable $_GET['page'] doesn't exist in the modalbox? I tried adding the page variable to the javascript, but it didn't work.

jQuery('#upload_logo_button').click(function() {
        formfield = jQuery('#deelnemer_logo_upload').attr('name');
        tb_show('', '../wp-admin/media-upload.php?type=image&TB_iframe=true&width=640&height=345');
        return false;

Any tips, suggestions?



Browse other questions tagged or ask your own question.