You are here

function manualcrop_image_style_flush in Manual Crop 7

Implements hook_image_style_flush().

File

./manualcrop.module, line 186

Code

function manualcrop_image_style_flush($style) {
  if (!empty($style['effects'])) {
    $effect = reset($style['effects']);
    if (_manualcrop_is_own_effect($effect)) {

      // Leave if this style has a Manual Crop effect.
      return;
    }
  }

  // Delete all crop selections if the image style doesn't have a Manual Crop
  // effect. We do this here because there's no image effect delete hook.
  db_delete('manualcrop')
    ->condition('style_name', isset($style['old_name']) ? $style['old_name'] : $style['name'])
    ->execute();
}