function hook_colorbox_settings_alter in Colorbox 6
Same name and namespace in other branches
- 8 colorbox.api.php \hook_colorbox_settings_alter()
- 7.2 colorbox.api.php \hook_colorbox_settings_alter()
- 7 colorbox.api.php \hook_colorbox_settings_alter()
Allows to override Colorbox settings and style.
Implementation of hook_colorbox_settings_alter().
Parameters
$settings: An associative array of Colorbox settings. See the Colorbox documentation for the full list of supported parameters.
$style: The name of the active style plugin.
1 invocation of hook_colorbox_settings_alter()
- _colorbox_doheader in ./
colorbox.module - Loads the various js and css files.
File
- ./
colorbox.api.php, line 20 - API documentation for the colorbox module.
Code
function hook_colorbox_settings_alter(&$settings, &$style) {
// Disable automatic downscaling of images to maxWidth/maxHeight size.
$settings['scalePhotos'] = FALSE;
// Use custom style plugin specifically for node/123.
if ($_GET['q'] == 'node/123') {
$style = 'mystyle';
}
}