Thickbox Activation on Button Click

I’ve been doing quite a bit of WordPress hacking for a couple somewhat involved projects as of late. It took a little fumbling around to figure out how to get Thickbox to activate on a button click vs. the usual link click. The js code is below. Simply wrap it in a function and call it using the onclick event of the button:

tb_show('Thickbox title here', '#TB_inline?height=300&width=305&inlineId=CHANGE-ME-INPUT-ID-OF-BUTTON&modal=false', null);

Thanks to for the tip off.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.