You are here

function content_profile_migrate_fields_user in Migrate Extras 6

Implementation of hook_migrate_fields_user().

File

./content_profile.migrate.inc, line 11
Hooks to support content_profile when migrating users

Code

function content_profile_migrate_fields_user($type) {

  // Get any CCK fields attached to content profiles
  $cp_types = content_profile_get_types();
  $fields = array();
  foreach ($cp_types as $type => $info) {
    $profile_fields = migrate_invoke_all('fields_node', $type);
    foreach ($profile_fields as $key => $value) {
      if (preg_match('/^field_/', $key) || $key == 'title' || $key == 'body') {
        $profile_fields[$type . '|' . $key] = $info->name . ' ' . $value;
      }
      unset($profile_fields[$key]);
    }
    $fields = array_merge($fields, $profile_fields);
  }
  return $fields;
}