function link_field_prepare_view

Implements hook_field_prepare_view().

File

drupal/core/modules/field/modules/link/link.module, line 194
Defines simple link field types.

Code

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'],
      );
    }
  }
}