Created
June 22, 2016 20:41
-
-
Save gormus/43d7ab5b767c43e7ae44ccab508f0207 to your computer and use it in GitHub Desktop.
Improve taxonomy term add/edit form in Drupal 7.x
This file contains hidden or 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 | |
| /** | |
| * Implements hook_form_FORM_ID_alter(). | |
| */ | |
| function abc_form_taxonomy_form_term_alter(&$form, &$form_state) { | |
| // Move all fieldsets into vertical-tabs. | |
| $form['additional_settings'] = array( | |
| '#type' => 'vertical_tabs', | |
| ); | |
| foreach ($form as $key => $value) { | |
| if ( | |
| is_array($form[$key]) | |
| && isset($form[$key]['#type']) | |
| && ($form[$key]['#type'] === 'fieldset') | |
| ) { | |
| $form[$key]['#group'] = 'additional_settings'; | |
| } | |
| } | |
| // Hide `Description` field on term add/edit forms. | |
| $form['description']['#access'] = FALSE; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment