I'm working on my admin area theme and I wanted to make some modifications on the way the thickbox and tinyMCE looks. I could make most of the changes through adding custom stylesheets and JS to my admin area using wp_enqueue_script() and wp_enqueue_style() but I have had a hard time making some others changes. This is because the iframes containing the elements are either not reachable by my own styles or have in their head some other stylesheet and JS that override mine.

I more or less managed to bypass that using some JavaScript and the CSS !important declaration but I was wondering if there was any hooks that would allow me to call wp_enqueue_script() and wp_enqueue_style() to put my scripts inside those iframes headers? Some hook similar to admin_head or admin_init but for the thickbox or iframes?

link|improve this question
feedback

1 Answer

You could over-ride the CSS by using the admin_print_scripts and add css to match your needs. This can be done via the functions.php file or by creating a plugin. Here is the code in a plugin format to begin adding style:

<?php
/*
Plugin Name: Some Name
Description: Custom Thickbox Styles
*/
add_action('admin_print_styles', 'custom_tb_styles');
function custom_tb_styles() {
  ?>
  <style>
    #TB_window {
    background:silver;
    }
    /*
    YOUR CUSTOM STYLES HERE
    */
  </style>
  <?php
  }

If you're adding the code to your functions.php file you could just add this to the file:

<?php
add_action('admin_print_styles', 'custom_tb_styles');
function custom_tb_styles() {
  ?>
  <style>
    #TB_window {
    background:silver;
    }
    /*
    YOUR CUSTOM STYLES HERE
    */
  </style>
  <?php
  }

Another option is to unregister the Thickbox Styles and completely add your own.

link|improve this answer
better hook for the thickbox might be: add_action('admin_head-media-upload-popup','function'); – ungestaltbar Feb 8 at 21:43
feedback

Your Answer

 
or
required, but never shown

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