Make taxonomy/term edit form with vertical tabs

Public

Get raw version
php
  1. /**
  2.  * Make taxonomy/term/ID/edit vertical tabs
  3.  */
  4. function MODULE_form_taxonomy_form_term_alter(&$form, &$form_state, $form_id) {
  5.  
  6. $form['additional_settings'] = array(
  7. '#type' => 'vertical_tabs',
  8. '#weight' => 99,
  9. '#attached' => array(
  10. 'js' => array(drupal_get_path('module', 'node') . '/content_types.js'),
  11. ),
  12. );
  13.  
  14. foreach ($form as $delta => $element) {
  15. if (is_array($element)) {
  16. if (!empty($element['#type'])) {
  17. if ($element['#type'] == 'fieldset') {
  18. $form[$delta]['#group'] = 'additional_settings';
  19. $form['additional_settings'][$delta] = $form[$delta];
  20. unset($form[$delta]);
  21. }
  22. }
  23. }
  24. }
  25. }