Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / image / image.api.php
1 <?php
2
3 /**
4  * @file
5  * Hooks related to image styles and effects.
6  */
7
8 /**
9  * @addtogroup hooks
10  * @{
11  */
12
13 /**
14  * Alter the information provided in \Drupal\image\Annotation\ImageEffect.
15  *
16  * @param $effects
17  *   The array of image effects, keyed on the machine-readable effect name.
18  */
19 function hook_image_effect_info_alter(&$effects) {
20   // Override the Image module's 'Scale and Crop' effect label.
21   $effects['image_scale_and_crop']['label'] = t('Bangers and Mash');
22 }
23
24 /**
25  * Respond to image style flushing.
26  *
27  * This hook enables modules to take effect when a style is being flushed (all
28  * images are being deleted from the server and regenerated). Any
29  * module-specific caches that contain information related to the style should
30  * be cleared using this hook. This hook is called whenever a style is updated,
31  * deleted, or any effect associated with the style is update or deleted.
32  *
33  * @param \Drupal\image\ImageStyleInterface $style
34  *   The image style object that is being flushed.
35  */
36 function hook_image_style_flush($style) {
37   // Empty cached data that contains information about the style.
38   \Drupal::cache('mymodule')->deleteAll();
39 }
40
41 /**
42  * @} End of "addtogroup hooks".
43  */