1

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?

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
}
1
  • Thanks for that, and good effort on the 3.5 update - I've literally only just seen that it is out! – David Gard Dec 12 '12 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.