You are here

function _link_load in Link 7

Same name and namespace in other branches
  1. 6.2 link.inc \_link_load()
  2. 6 link.module \_link_load()

Unpacks the item attributes for use.

1 call to _link_load()
link_field_load in ./link.module
Implements hook_field_load().

File

./link.module, line 436
Defines simple link field types.

Code

function _link_load($field, $item, $instance) {
  if (isset($item['attributes'])) {
    if (!is_array($item['attributes'])) {
      $item['attributes'] = unserialize($item['attributes']);
    }
    return $item['attributes'];
  }
  elseif (isset($instance['settings']['attributes'])) {
    return $instance['settings']['attributes'];
  }
  else {
    return $field['settings']['attributes'];
  }
}