You are here

function imageapi_optimize_pipeline_delete in Image Optimize (or ImageAPI Optimize) 7.2

Deletes an image pipeline.

Parameters

$pipeline: An image pipeline array.

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

Return value

TRUE on success.

1 call to imageapi_optimize_pipeline_delete()
imageapi_optimize_pipeline_delete_form_submit in ./imageapi_optimize.admin.inc
Submit handler to delete an image pipeline.

File

./imageapi_optimize.module, line 386

Code

function imageapi_optimize_pipeline_delete($pipeline, $replacement_pipeline_name = '') {
  imageapi_optimize_pipeline_flush($pipeline);
  db_delete('imageapi_optimize_processors')
    ->condition('isid', $pipeline['isid'])
    ->execute();
  db_delete('imageapi_optimize_pipelines')
    ->condition('isid', $pipeline['isid'])
    ->execute();

  // Let other modules update as necessary on save.
  $pipeline['old_name'] = $pipeline['name'];
  $pipeline['name'] = $replacement_pipeline_name;
  module_invoke_all('imageapi_optimize_pipeline_delete', $pipeline);
  return TRUE;
}