Resize the WP media Uploader iFrame

I’m trying to customize the look of the iframe that pops up (media uploader).

I’ve manage to remove some fields etc, but I cannot re-size the frame. Does anybody know how to do this?

Related posts

1 comment

  1. The default media box has hard coded HTML values so in order to alter the CSS for it you you have 2 options.

    1. Enqueue your own CSS and override the values
    2. Disable media-views.css completely and load a custom stylesheet.

    To enqueue your own style:

    function blah_admin_css() {
        wp_enqueue_style( 'blah_admin_css', path to your custom.css );
    }
    add_action('admin_print_styles', 'blah_admin_css' );
    

    Now just add whatever you want to a custom.css file to override the CSS values, you might have to use the dreaded !important.

    To completely disable the admin CSS from loading for the media box you need to hook into wp_default_styles and the name which happens to be media-views.

    For example:

    function remove_media_style($wp_styles ){
        $wp_styles->remove('media-views');
    }
    add_action('wp_default_styles', 'remove_media_style');
    

    You should use a plugin to do this since you just have to disable it to revert back to the original style.

    ps. There is a 3rd option, just use javascript, and generally speaking all 3 options are a bad idea.

Comments are closed.