function link_field in Link 5
Same name and namespace in other branches
- 6.2 link.module \link_field()
- 6 link.module \link_field()
Implementation of hook_field().
File
- ./
link.module, line 227 - Defines simple link field types.
Code
function link_field($op, &$node, $field, &$items, $teaser, $page) {
switch ($op) {
case 'load':
foreach ($items as $delta => $item) {
$items[$delta]['attributes'] = unserialize($item['attributes']);
}
break;
case 'view':
foreach ($items as $delta => $item) {
$items[$delta]['view'] = content_format($field, $items[$delta], 'default', $node);
}
return theme('field', $node, $field, $items, $teaser, $page);
break;
}
}