function image_style_delete

Deletes an image style.

Parameters

$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.

1 call to image_style_delete()
image_style_delete_form_submit in modules/image/image.admin.inc
Submit handler to delete an image style.

File

modules/image/image.module, line 735

Code

function image_style_delete($style, $replacement_style_name = '') {
    image_style_flush($style);
    db_delete('image_effects')->condition('isid', $style['isid'])
        ->execute();
    db_delete('image_styles')->condition('isid', $style['isid'])
        ->execute();
    // Let other modules update as necessary on save.
    $style['old_name'] = $style['name'];
    $style['name'] = $replacement_style_name;
    module_invoke_all('image_style_delete', $style);
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.