You are here

function name_update_7000 in Name Field 7

Move the user field selected realname into a variable to avoid doing lookups on all user fields / instances during hook_user_load().

File

./name.install, line 154
Standard installation functions for name.

Code

function name_update_7000() {
  foreach (field_info_instances('user', 'user') as $instance) {
    $field = field_info_field($instance['field_name']);
    if ($field['type'] == 'name' && !empty($instance['settings']['override_username'])) {
      variable_set('name_user_preferred', $instance['field_name']);
      break;
    }
  }
}