How to Add Custom CSS to the Media Thickbox?

I’ve added a couple of custom fields to the Edit Media screen, but when these are displayed in the WP Media Thickbox (when adding images from the Edit Post screen, for example), the styling is gone.

Is there a hook to add my custom css to the Thickbox iframe when it loads?

Related posts

Leave a Reply

1 comment

  1. In WordPress 3.5, this hook works for me:

    add_action( 'print_media_templates', 'wpse_75746_print_style_35' );
    
    function wpse_75746_print_style_35()
    {
        ?>
        <style>
            .media-modal-content, .media-sidebar {
                background: #FFF2D4 !important;
            }   
        </style>
        <?php
    }
    

    In 3.4.2, this is the one:

    add_action( 'admin_print_styles-media-upload-popup', 'wpse_75746_print_style_342' );
    
    function wpse_75746_print_style_342()
    {
        ?>
        <style>
            #media-upload {
                background: #FFF2D4 !important;
            }
        </style>
        <?php
    }