You are here

function noderelationships_cck_backref_delete in Node Relationships 6

Delete a back reference field.

1 call to noderelationships_cck_backref_delete()
noderelationships_cck_backref_sync_fields in ./noderelationships.inc
Synchronize back reference settings with back reference fields.

File

./noderelationships.inc, line 649
Common functions for the noderelationships module.

Code

function noderelationships_cck_backref_delete($type_name, $field_name) {

  // Load the Create/Read/Update/Delete library for CCK objects.
  module_load_include('inc', 'content', 'includes/content.crud');

  // Make sure the field exists and it belongs to us.
  $read_params = array(
    'field_name' => $field_name,
    'type_name' => $type_name,
    'widget_module' => 'noderelationships',
  );
  $instances = content_field_instance_read($read_params, TRUE);
  if (!empty($instances)) {
    content_field_instance_delete($field_name, $type_name, FALSE);
  }
}