Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am writing a plugin that depends on modal dialogs for screen space.

Right now I am using jQuery to create the dialogs, but I want a way that integrates better into the admin theme.

Obviously WP has to have some sort of native dialog system (it's used for uploads). How do I access it?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The WordPress admin area uses Thickbox, which is still a jQuery plugin (jQuery is used all over the admin area). You need to enqueue the script and style (add_thickbox() does this for you), and then all links that have class thickbox will be converted. You need to add some URL parameters too, for example the image upload link looks like this: media-upload.php?post_id=735&type=image&TB_iframe=1&width=640&height=285. post_id and type are WordPress-specific, but TB_iframe, width and height are needed for Thickbox, and you should use them in your own links too.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.