function follow_link_save in Follow 7.2
Same name and namespace in other branches
- 5 follow.module \follow_link_save()
- 6 follow.module \follow_link_save()
- 7 follow.module \follow_link_save()
Inserts a new link, or updates an existing one.
Parameters
$link: A link object to be saved.
1 call to follow_link_save()
- follow_links_form_submit in ./
follow.module - Submit handler for the follow_links_form.
File
- ./
follow.inc, line 271 - Follow module API and helper functions.
Code
function follow_link_save($link) {
$parsed = follow_parse_url($link->url);
$link->path = $parsed['path'];
$link->options = $parsed['options'];
if (isset($link->lid)) {
drupal_write_record('follow_links', $link, 'lid');
}
else {
drupal_write_record('follow_links', $link);
}
return $link;
}