Quick Flickr Widget: Empowered by Thickbox

Finally, version 1.2.4 is public! Can you belive this? I managed to get Thickbox running with the widget! No, it wasn’t that difficult at all. Here are the two tricks:

In the plugin init:

	$options = get_option("pluginname");
	if ($options["thickbox"] == "checked")
	{
		wp_enqueue_script("thickbox");
		add_action("wp_head", "pluginname_thickbox_inject", 10);
	}

And the thickbox inject function:

function pluginname_thickbox_inject() {
    ?>
    <link rel="stylesheet" href="<?= get_option("siteurl"); ?>/<?= WPINC; ?>/js/thickbox/thickbox.css" type="text/css" media="screen" />

    <script type="text/javascript">
    var tb_pathToImage = "<?= get_option("siteurl"); ?>/<?= WPINC; ?>/js/thickbox/loadingAnimation.gif";
    var tb_closeImage = "<?= get_option("siteurl"); ?>/<?= WPINC; ?>/js/thickbox/tb-close.png"
    </script>

    <?php
}

That’s all. Then use Thickbox the ordinary way you would. Oh and don’t forget to check out the Quick Flickr Widget page for more info on the plugin and once again thank you for all your feedback. It really helps a lot!