Implements hook_field_prepare_view().
function link_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
foreach ($entities as $id => $entity) {
foreach ($items[$id] as $delta => &$item) {
// Split out the link into the parts required for url(): path and options.
$parsed = drupal_parse_url($item['url']);
$item['path'] = $parsed['path'];
$item['options'] = array(
'query' => $parsed['query'],
'fragment' => $parsed['fragment'],
'attributes' => &$item['attributes'],
);
}
}
}