You are here

function paragraphs_bundle_delete in Paragraphs 7

Function to delete a bundle.

Parameters

string $bundle_machine_name: Machine name of the bundle to delete.

1 call to paragraphs_bundle_delete()
paragraphs_admin_bundle_delete_form_submit in ./paragraphs.admin.inc
Process and confirm paragraphs bundle deletion.

File

./paragraphs.module, line 1021
Paragraphs hooks and common functions.

Code

function paragraphs_bundle_delete($bundle_machine_name) {
  $bundle = paragraphs_bundle_load($bundle_machine_name);
  if ($bundle) {
    db_delete('paragraphs_bundle')
      ->condition('bundle', $bundle->bundle)
      ->execute();
    field_attach_delete_bundle('paragraphs_item', $bundle->bundle);
    paragraphs_bundle_load(NULL, TRUE);
    entity_info_cache_clear();
    variable_set('menu_rebuild_needed', TRUE);
  }
}