Adding a Select List (Text) field to an entity bundle programmatically I've been searching for hours, but can't seem to find a solution to this. Now, I'm able to create a plain old text field as such as this:

In moduleA.install:

if (!field_info_field('field_myfield')) {
  $field = array(
    'field_name' =&gt; 'field_myfield',
    'type' =&gt; 'text',
  );
  field_create_field($field);
}


Then, in moduleB.install, I add that field to a specific taxonomy bundle:

$instance = array(
  'field_name' =&gt; 'field_myfield',
  'entity_type' =&gt; 'taxonomy_term',
  'label' =&gt; 'MyField',
  'bundle' =&gt; 'new_terms',
  'widget' =&gt; array(
      'type' =&gt; 'text',
  ),
);
field_create_instance($instance);


What I would like is the field it creates to be a select list, instead of just a text field. I've been looking around, trying to figure it out (using "list-select" in place of type), but any time I've deviated from what's above, I get an error on field_create_instance when installing moduleB. I realize it's probably (hopefully) something as simple as knowing the proper widget name, but I either can't seem to find it, or am searching for the wrong thing.
The field type would be list_text (as defined in list_field_info(), and the widget type is options_select, as defined in options_field_widget_info().

Kind of tricky to track down, but this little snippet should help in future:

$entity_type = 'node';
$field_name = 'field_name';
$bundle_name = 'article';

$info_config = field_info_field($field_name);
$info_instance = field_info_instance($entity_type, $field_name, $bundle_name);
unset($info_config['id']);
unset($info_instance['id'], $info_instance['field_id']);
include_once DRUPAL_ROOT . '/includes/utility.inc';
$output = "field_create_field(" . drupal_var_export($info_config) . ");\n";
$output .= "field_create_instance(" . drupal_var_export($info_instance) . ");";
drupal_set_message("&lt;textarea rows=30 style=\"width: 100%;\"&gt;". $output .'&lt;/textarea&gt;');


It'll get you a complete field and instance definition of an existing field, ready to use in code.