You are here

function commerce_delete_fields in Commerce Core 7

Enables and deletes fields of the specified type.

Parameters

$type: The type of fields to enable and delete.

See also

commerce_delete_field()

4 calls to commerce_delete_fields()
commerce_customer_uninstall in modules/customer/commerce_customer.install
Implements hook_uninstall().
commerce_line_item_uninstall in modules/line_item/commerce_line_item.install
Implements hook_uninstall().
commerce_price_uninstall in modules/price/commerce_price.install
Implements hook_uninstall().
commerce_product_reference_uninstall in modules/product_reference/commerce_product_reference.install
Implements hook_uninstall().

File

./commerce.module, line 189
Defines features and functions common to the Commerce modules.

Code

function commerce_delete_fields($type) {

  // Read the fields for any active or inactive field of the specified type.
  foreach (field_read_fields(array(
    'type' => $type,
  ), array(
    'include_inactive' => TRUE,
  )) as $field_name => $field) {
    commerce_delete_field($field_name);
  }
}