Manipulating Media uploader

what i ended up doing was launching the thickbox uploaded manually via a jquery click event. then with setInterval i was able to hide the pieces i wanted. jQuery(document).ready(function($) { $(‘.specialclass’).click(function() { //get post id from somewhere (for me this was the row column string = $(this).parents(‘tr.type-portfolio’).attr(‘id’); if(/post-(\d+)/.exec(string)[1]) post_id = parseInt(/post-(\d+)/.exec(string)[1], 10); tbframe_interval = setInterval(function() … Read more

Image uploader with “Set Featured Image” link on front end

To get the “Use as featured Image” link you have to pass post_id to the media-upload.php file with the url so the request will be changed to: var post_id = 234 // retrive the post id via php var request = url.media_upload+’?post_id=’+post_id+’type=image&TB_iframe=true’; Make sure you add the post_id very first of the url. It didn’t … Read more

how to use thickbox in admin?

Below, an example of what’s needed to use ThickBox. <?php wp_enqueue_style(‘thickbox’); wp_enqueue_script(‘thickbox’); ?> <a href=”#” id=”taxonomy_banner_image” class=”taxonomy_banner_image”> Click Here </a> <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(“#taxonomy_banner_image”).click(function() { tb_show(“”, “filename?TB_iframe=true”); return false; }); }); </script> tb_show parameters: title of the box. url of file and with parameter iframe=true I think this will give you an idea how … Read more

Thickbox hacking – removing fields

Tricky but once you understand how WordPress sets the sizes and the fields then the rest is easy: function thickbox_fields($form_fields, $post){ unset( $form_fields[‘post_title’], //disables “Title” field and so forth… $form_fields[‘url’], $form_fields[‘image_alt’], $form_fields[‘post_excerpt’], $form_fields[‘post_content’], $form_fields[‘align’], $form_fields[‘image-size’] ); //create the size input for full only and set display to none $size=”full”; $css_id = “image-size-{$size}-{$post->ID}”; $html = “<div … Read more

Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

You could over-ride the CSS by using the admin_print_scripts admin_head-media-upload-popup 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_head-media-upload-popup’, ‘custom_tb_styles’); … Read more