How would I get this to work – send to post from thick box

The correct way to do this is to: $(‘#upload-background-image-one’).click(function() { formfield = $(‘#background-size-one’).attr(‘name’); tb_show(”, ‘media-upload.php?type=image&TB_iframe=true’); // Take the selected image and insert only the src path into the text field. window.send_to_editor = function(html) { img_url = $(‘img’, html).attr(‘src’); $(‘#background-size-one’).val(img_url); tb_remove(); } return false; }); because when you click on a button you instantiate a call … Read more

Media button Thickbox content doesn’t work everywhere

I ended up solving this by changing my two functions to only one, and setting the “button” to show the iframe directly, like this: function add_custom_media_button() { $cu = wp_get_current_user(); $cusername = $cu->user_login; $clocale = get_locale(); echo ‘<a href=”http://nephila.cloudapp.net/GAdEWeb/wpsearch.aspx?wpuser=” . $cusername . “&wplang=’ . $clocale . ‘&TB_iframe=true&width=800&height=600″ id=”insert-my-media” class=”button thickbox”>Add custom media</a>’; } add_action(‘media_buttons’, ‘add_custom_media_button’, … Read more

WP Dashboard video modal on load

I found an old thread, How to stop showing admin notice after close button has been clicked, related to your question. I think the accepted answer’s b) method could be applied to your situation. b. Keep a history of the dismissal of the notice, with your own dismiss action: function my_plugin_notice() { $user_id = get_current_user_id(); … Read more

How to modify iFrame content in an admin thickbox

jQuery(document).ready(function($) { $(‘.yourlink’).click(function() { tbframe_interval = setInterval(function() { $(‘#TB_iframeContent’).contents().find(‘.savesend input[type=”submit”]’).val(‘changed the button text’); }, 2000); tb_show(”, ‘media-upload.php?type=image&TB_iframe=true’); return false; }); }); http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/ you can also enqueue a script on the media upload page that should be available in you iframe, don’t know if that will do it though. am working on something very similar to … Read more