function _link_process in Link 6.2
Same name and namespace in other branches
- 6 link.module \_link_process()
- 7 link.module \_link_process()
1 call to _link_process()
- link_field in ./link.module
- Implementation of hook_field().
File
- ./link.inc, line 16
- Helper functions for Link field, widget and form elements.
Code
function _link_process(&$item, $delta = 0, $field, $node) {
$item['url'] = trim($item['url']);
if (empty($item['attributes'])) {
$item['attributes'] = array();
}
$item['attributes'] = serialize($item['attributes']);
if (isset($field['widget']['default_value'][$delta]['url']) && $item['url'] == $field['widget']['default_value'][$delta]['url'] && is_object($node)) {
if (!link_validate_url($item['url'])) {
$item['url'] = NULL;
}
}
if (!isset($item['title'])) {
$item['title'] = NULL;
}
}