function image_field_caption_theme_registry_alter in Image Field Caption 7
Same name and namespace in other branches
- 7.2 image_field_caption.module \image_field_caption_theme_registry_alter()
Implements hook_theme_registry_alter().
File
- ./
image_field_caption.module, line 269 - Provides a caption textarea for image fields.
Code
function image_field_caption_theme_registry_alter(&$theme_registry) {
// Override image theme functions and add 'caption' as a variable to be
// assembled by theme() for each.
$theme_path = drupal_get_path('module', 'image_field_caption');
$overrides = array(
'image_formatter',
'image_style',
);
foreach ($overrides as $type) {
if (isset($theme_registry[$type])) {
$theme_registry[$type]['theme path'] = $theme_path;
$theme_registry[$type]['function'] = 'image_field_caption_theme_image';
$theme_registry[$type]['variables']['caption'] = NULL;
$theme_registry[$type]['variables']['image_field_caption_type'] = $type;
}
}
}