You are here

function isotope_example_uninstall in Isotope (with Masonry and Packery) 7.2

Implements hook_uninstall().

Delete sample data.

File

isotope_example/isotope_example.install, line 116
Create sample data to be used in isotope example.

Code

function isotope_example_uninstall() {

  // Delete the example nodes.
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'node')
    ->propertyCondition('type', 'isotope_example');
  $result = $query
    ->execute();
  if (!empty($result['node'])) {
    foreach ($result['node'] as $node) {
      node_delete($node->nid);
    }
  }

  // Delete the example fields.
  $fields = array(
    'isotope_example_color',
    'isotope_example_shape',
    'isotope_example_size',
  );
  foreach ($fields as $field_name) {
    field_delete_field($field_name);
  }
}