drush_field_create_wizard

  1. drupal
    1. 7 field.drush.inc function
Drupal 7 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

sites/all/modules/drush/commands/core/field.drush.inc, line 336
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);
}