Two instances of thickbox
-
I hope this is the right place to ask this.
I am developing a WordPress plugin. In the plugin I am using the media_buttons function to add a button in the page/post editor. When this is clicked, I need to also put a media uploader inside. The problem is both of these functions use thickbox. I need the meida uploader it to be on top of the media buttons box.
Below is an image of what is currently happening. As you can see, the media uploader thickbox is appending itself to the bottom of the other thickbox.
Here is my code for the media button:
add_action('media_buttons', 'wpepdd_add_my_media_button', 20); function wpepdd_add_my_media_button() { echo '<a href="#TB_inline?width=600&height=400&inlineId=wpepdd_popup_container" title="Easy Digital Download" id="insert-my-media" class="button thickbox">Easy Digital Download</a>'; }
Here is my code for the media uploader:
// media uploader function load_admin_things() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); } load_admin_things(); ?> <script> jQuery(document).ready(function() { var formfield; jQuery('.upload_image_button').click(function() { jQuery('html').addClass('Image'); formfield = jQuery(this).prev().attr('name'); tb_show('', 'media-upload.php?type=image&TB_iframe=true'); return false; }); window.original_send_to_editor = window.send_to_editor; window.send_to_editor = function(html){ if (formfield) { fileurl = jQuery('img',html).attr('src'); jQuery('#'+formfield).val(fileurl); tb_remove(); jQuery('html').removeClass('Image'); } else { window.original_send_to_editor(html); } }; }); </script>
I have searched heavily and have yet to find a solution to this. Thanks for any help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Two instances of thickbox’ is closed to new replies.