function drush_field_create_wizard

8.0.x field.drush.inc drush_field_create_wizard()
6.x field.drush.inc drush_field_create_wizard()
7.x field.drush.inc drush_field_create_wizard()
4.x field.drush.inc drush_field_create_wizard()
5.x field.drush.inc drush_field_create_wizard()

Prompt user enough to create basic field and instance.

Return value

array $field_spec An array of brief field specifications.

1 call to drush_field_create_wizard()

File

commands/core/field.drush.inc, line 364
Field API's drush integration

Code

function drush_field_create_wizard() {
  $specs[] = drush_prompt(dt('Field name'));
  module_load_include('inc', 'field_ui', 'field_ui.admin');
  $types = field_ui_field_type_options();
  $field_type = drush_choice($types, dt('Choose a field type'));
  $specs[] = $field_type;
  $widgets = field_ui_widget_type_options($field_type);
  $specs[] = drush_choice($widgets, dt('Choose a widget'));
  return implode(',', $specs);
}