Say I have this field, "map_description". I know I would this function to define the field:
$field = array( 'field_name' => 'map_description', 'cardinality' => 1, 'type' => 'text', ); field_create_field($field);
And I have this code which I'm not sure what it does but I'm told that I'll need it:
$instance = array( 'field_name' => 'map_description', 'label' => 'The map description.', 'bundle' => 'my_content_type', 'entity_type' => 'node', 'widget' => array( 'type' => 'text_textfield', ); field_create_instance($instance)
Those two code bits are both in my install hook and run when I install the module. But while the fields are in fact created, I have to manually assign them to the content type via "manage fields", is there a way to have the fields automatically assigned to the content type?