Last active
August 29, 2015 14:06
-
-
Save LostKobrakai/9dbfb29ee8d1515bcd69 to your computer and use it in GitHub Desktop.
ProcessWire: Remove field via API
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
<?php | |
if ($user->isSuperuser()) { | |
//first remove the fields from 'user' template before deleting them. | |
$t = $templates->get('user'); | |
$fg = $t->fieldgroup; | |
$fg->remove($fields->get('your_field')); | |
$fg->save(); | |
//delete the fields | |
$f = $fields->get('your_field'); | |
$fields->delete($f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment