2

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?

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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