Change or update field instance programmatically in Drupal 7. For more information check out Field CRUD API in drupal.org.
Source code viewer
// Load field instance, the parameters in right order are: entity type, field name, bundle name. $instance = field_read_instance('node', 'field_files', 'news'); // Change values $instance['settings']['description_field'] = 1; // Save or update field instance. field_update_instance($instance);Programming Language: PHP