Custom Text in Media Uploader in a Theme Options Page

This is a short version of what I do in one of my plugins. I copied this behavior from the plugin Advanced Custom Fields (some versions ago, donnow how it proceeds now). 1) When calling the thickbox, add a custom query var (mtt_type in this case): tb_show(‘{$mtt_title}’, ‘media-upload.php?type=image&mtt_type=image&TB_iframe=true’); 2) Print scripts in media-upload.php to modify … Read more

Form within thickbox

The issue you are running into is partially an HTML issue. Forms cannot be nested. You are likely putting this inside of another form (as a great bulk of the backend is already forms). WordPress provides good handling for receiving submitted data to extend core functionality. I suggest that you look into this and figure … Read more

Adding URL of PDF from Thickbox in a Meta Box

This line… imgurl = jQuery(‘img’,html).attr(‘src’); Means that jQuery is getting the “source” (i.e. full path) of the image. As you’ve guessed, that won’t work for a PDF file. What you’ll probably have to do is get the id of the attachment instead. Could you possibly update your original answer with the HTML SOURCE of the … Read more

Howto use WP built in Thickbox for images?

What if you try adding this to your functions.php function tb(){ wp_enqueue_script(‘thickbox’,null,array(‘jquery’)); wp_enqueue_style(‘thickbox.css’, “https://wordpress.stackexchange.com/”.WPINC.’/js/thickbox/thickbox.css’, null, ‘1.0’); } add_action(‘wp_enqueue_scripts’,’tb’); and keeping your bit of jQuery (not sure what your are needing those php variables for): jQuery(document).ready(function() { jQuery(“img”).parent(“a”).addClass(“thickbox”); });