function field_ui_form_node_type_form_alter
Same name in other branches
- 9 core/modules/field_ui/field_ui.module \field_ui_form_node_type_form_alter()
- 8.9.x core/modules/field_ui/field_ui.module \field_ui_form_node_type_form_alter()
Implements hook_form_FORM_ID_alter().
Adds a button 'Save and add fields' to the 'Create content type' form.
See also
field_ui_form_node_type_form_submit()
File
-
modules/
field_ui/ field_ui.module, line 388
Code
function field_ui_form_node_type_form_alter(&$form, $form_state) {
// We want to display the button only on add page.
if (empty($form['#node_type']->type)) {
$form['actions']['save_continue'] = array(
'#type' => 'submit',
'#value' => t('Save and add fields'),
'#weight' => 45,
);
$form['#submit'][] = 'field_ui_form_node_type_form_submit';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.