function image_style_delete

Delete an image style.

Parameters

Drupal\image\Plugin\Core\Entity\ImageStyle $style: An image style array.

$replacement_style_name: (optional) When deleting a style, specify a replacement style name so that existing settings (if any) may be converted to a new style.

Return value

TRUE on success.

3 calls to image_style_delete()
image_config_import_delete in drupal/core/modules/image/image.module
Implements MODULE_config_import_delete().
image_style_delete_form_submit in drupal/core/modules/image/image.admin.inc
Submit handler to delete an image style.
image_style_form_submit in drupal/core/modules/image/image.admin.inc
Submit handler for saving an image style.

File

drupal/core/modules/image/image.module, line 609
Exposes global functionality for creating image styles.

Code

function image_style_delete($style, $replacement_style_name = '') {
  $style
    ->delete();

  // Let other modules update as necessary on save.
  if ($replacement_style_name) {
    $style
      ->set('name', $replacement_style_name);
  }
  module_invoke_all('image_style_delete', $style);
  return TRUE;
}