Last active
October 4, 2019 16:23
-
-
Save lincoln-chawora/3ea7c5c55388607b9b92bc1654299cc7 to your computer and use it in GitHub Desktop.
How to delete a field from a paragraph in drupal 8 using hook n update, this function would go inside the .install file of you module.
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
function YOUR_MODULE_NAME_update_8001(&$sandbox) { | |
FieldStorageConfig::loadByName('paragraphs_type', 'example_field_name')->delete(); | |
FieldConfig::loadByName('paragraph', 'example_paragraph_name', 'example_field_name')->delete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found at: https://drupal.stackexchange.com/questions/253710/how-do-you-programmatically-delete-a-field/253714