/** * This will add the JavaScript to the footer. */ function add_thickbox_js() { if (is_thickbox_enabled() === false) { return; } $url = get_bloginfo('wpurl') . THICKBOX_URL; echo "\n"; if (INCLUDE_SMOOTHBOX) { echo '<script src="' . $url . '/smoothbox/mootools.v1.11.js" type="text/javascript"></script>' . "\n"; echo '<script src="' . $url . '/smoothbox/smoothbox.js" type="text/javascript"></script>' . "\n"; } else { $imgurl = get_bloginfo('wpurl') . THICKBOX_URL . '/thickbox/images/'; if (INCLUDE_JQUERY) { echo '<script src="' . $url . '/thickbox/jquery.js" type="text/javascript"></script>' . "\n"; } if (INCLUDE_THICKBOX_JAVASCRIPT) { echo '<script src="' . $url . '/thickbox.php?' . THICKBOX_ACTION . '=js&url=' . urlencode($imgurl) . '" type="text/javascript"></script>' . "\n"; } } }
/** * In case the user wants to use the styles bundled with WordPress. */ function thickbox_plugin_enqueue_styles() { if (is_thickbox_enabled() === false) { return; } if (use_wordpress_default_script_and_style() === false) { return; } wp_enqueue_style('thickbox'); }