Showing a Thickbox (tb_show) does nothing
-
I’m trying to add a media uploader to a widget/plugin and I’m at the stage where I need to add a picture from the media library (or upload a new one).
I added some javascript and added an event to a button in the plugin. This event gets fired (because the alert is displayed), but the thickbox does not show up.
Here’s the JS code:
jQuery(document).ready(function() { jQuery('.upload_image_button').click(function() { alert('This alert is displayed'); tb_show('Upload a Image', 'media-upload.php&type=image&TB_iframe=true', false); return false; }); });
And it is being included like this to be dependent on thickbox and media upload:
wp_enqueue_script('my_upload_script', get_template_directory_uri() . '/js/script.js', array('jquery', 'thickbox', 'media-upload'));
Why isn’t the Thickbox displayed?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Showing a Thickbox (tb_show) does nothing’ is closed to new replies.