0) { foreach ($vocabs as $vid => $taxonomy) { if (isset($form_state['#node_widget_settings']['taxonomy_'. $vid]) && !$form_state['#node_widget_settings']['taxonomy_'. $vid]) { unset($extra['taxonomy'][$vid]); } } } // Remove fieldset unset($extra['taxonomy']['#type']); unset($extra['taxonomy']['#title']); unset($extra['taxonomy']['#collapsible']); unset($extra['taxonomy']['#collapsed']); $form['taxonomy'] = $extra['taxonomy']; } } /** * Implementation of hook_node_widget_widget_settings() */ function taxonomy_node_widget_widget_settings($type) { $settings = array(); $vocabs = taxonomy_get_vocabularies($type->type); foreach ($vocabs as $vid => $taxonomy) { $settings[] = array( 'name' => 'taxonomy_'. $vid, 'label' => $taxonomy->name, 'supported' => TRUE, 'message' => NULL, ); } return $settings; } /** * Implementation of hook_node_widget_is_empty() */ function taxonomy_node_widget_is_empty($form, $form_state) { // TODO return FALSE; }