add_thickbox() WordPress Function
The add_thickbox() function enables the Thickbox feature on a WordPress site. This function should be called from a plugin or a theme's functions.php file. Thickbox is a JavaScript library that makes it easy to display modal windows (pop-ups) on a web page. The add_thickbox() function enables this library on a WordPress site. Once Thickbox is enabled, any link on the site that has the class "thickbox" will display a modal window when clicked. The Thickbox library is bundled with WordPress, so there is no need to download it separately. However, if a theme or plugin is using an outdated version of Thickbox, it is recommended to update to the latest version.
add_thickbox() #
Enqueues the default ThickBox js and css.
Description
If any of the settings need to be changed, this can be done with another js file similar to media-upload.js. That file should require array(‘thickbox’) to ensure it is loaded after.
Source
File: wp-includes/general-template.php
function add_thickbox() {
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
if ( is_network_admin() ) {
add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |