Commit 8e93aade authored by Dries's avatar Dries

- Patch #875326 by effulgentsia: add hook_image_effect_info_alter().

parent dde18582
......@@ -29,6 +29,8 @@
* $form array providing a configuration form for this image effect.
* - "summary theme": (optional) The name of a theme function that will output
* a summary of this image effect's configuration.
*
* @see hook_image_effect_info_alter()
*/
function hook_image_effect_info() {
$effects = array();
......@@ -44,6 +46,20 @@ function hook_image_effect_info() {
return $effects;
}
/**
* Alter the information provided in hook_image_effect_info().
*
* @param $effects
* The array of image effects, keyed on the machine-readable effect name.
*
* @see hook_image_effect_info()
*/
function hook_image_effect_info_alter(&$effects) {
// Override the Image module's crop effect with more options.
$effect['image_crop']['effect callback'] = 'mymodule_crop_effect';
$effect['image_crop']['form callback'] = 'mymodule_crop_form';
}
/**
* Respond to image style updating.
*
......
......@@ -912,6 +912,7 @@ function image_effect_definitions() {
}
}
uasort($effects, '_image_effect_definitions_sort');
drupal_alter('image_effect_info', $effects);
cache_set("image_effects:$langcode", $effects);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment