function drush_field_create_wizard

8.0.x drush_field_create_wizard()
6.x drush_field_create_wizard()
7.x drush_field_create_wizard()
4.x drush_field_create_wizard()
5.x 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()


commands/core/, line 336
Field API's drush integration


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);