2

Does the WordPress API have a Modal Dialog like BootStrap does?

In my WordPress Plugin admin page - the plugin settings page accessed through the Dashboard - I would like to have modal dialogs appear and allow the user to edit settings.

WordPress has the classes button, wp-list-table, tablenav, etc. I was thinking that there might also be a modal dialog class with some associated Javascript API functions to make it appear and disappear?

1
  • No, it does not.
    – Trang
    Jul 23, 2015 at 6:12

1 Answer 1

9

Yes, WordPress has modal dialog and it is called as Thickbox, but I am not sure how flexible it is to implement what you want to. Here is the code -

<?php add_thickbox(); ?>
<div id="my-content-id" style="display:none;">
     <p>
          This is my hidden content! It will appear in ThickBox when the link is clicked.
     </p>
</div>

<a href="#TB_inline?width=600&height=550&inlineId=my-content-id" class="thickbox">View my inline content!</a>   

Refer for more details - https://codex.wordpress.org/Javascript_Reference/ThickBox

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.