Last active
October 4, 2019 16:18
-
-
Save lincoln-chawora/9ca524e4e569a4b03dbd88245175f96f to your computer and use it in GitHub Desktop.
How to delete a field instance in drupal 7 using hook n update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delete field instance field_journey_image_type. | |
*/ | |
function YOUR_THEME_journey_module_video_update_7001() { | |
$field_journey_image_type = field_info_instance('paragraphs_item', 'field_journey_image_type', 'journey_module_video'); | |
if (!is_null($field_journey_image_type)) { | |
field_delete_instance($field_journey_image_type); | |
field_purge_batch(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment