function field_delete_field

Marks a field and its instances and data for deletion.

Parameters

$field_name: The field name to delete.

Deprecated

as of Drupal 8.0. Use $field->delete().

Related topics

7 calls to field_delete_field()
comment_uninstall in drupal/core/modules/comment/comment.install
Implements hook_uninstall().
CrudTest::testDeleteField in drupal/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
Test the deletion of a field.
FileFieldValidateTest::testRequired in drupal/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
Tests the required property on file fields.
forum_uninstall in drupal/core/modules/forum/forum.install
Implements hook_uninstall().
NodeTranslationUITest::testFieldTranslationForm in drupal/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
Tests field translation form.

... See full list

File

drupal/core/modules/field/field.crud.inc, line 172
Field CRUD API, handling field and field instance creation and deletion.

Code

function field_delete_field($field_name) {
  if ($field = field_info_field($field_name)) {
    $field
      ->delete();
  }
}