You are here

function name_field_update_instance in Name Field 7

Implements hook_field_update_instance().

File

./name.module, line 1625
Defines an API for displaying and inputing names.

Code

function name_field_update_instance($instance, $prior_instance) {

  // I'm only targeting user entities here.
  if ($instance['entity_type'] == 'user') {
    if (!empty($instance['settings']['name_user_preferred'])) {
      variable_set('name_user_preferred', $instance['field_name']);
    }
    elseif (!empty($prior_instance['settings']['name_user_preferred'])) {
      variable_set('name_user_preferred', '');
    }
  }
}