You are here

function _tac_fields_disable_field in Taxonomy Access Control 6

Helper function to delete all access rules for a field.

Parameters

$field: The machine name of the field we are releasing.

1 call to _tac_fields_disable_field()
tac_fields_delete in tac_fields/tac_fields.admin.inc

File

tac_fields/tac_fields.admin.inc, line 265
Administrative interface for TAC Fields.

Code

function _tac_fields_disable_field($field) {

  // Remove all records for the field from the database.
  db_query("DELETE FROM {term_field_access} \n     WHERE field = '%s'", $field);
  db_query("DELETE FROM {term_field_access_defaults} \n     WHERE field = '%s'", $field);
  drupal_set_message(t('All term access rules for field %field have been deleted.', array(
    '%field' => $field,
  )));
  drupal_goto('admin/user/tac_fields');
}