function _parser_common_syndication_link in Feeds 6
Same name and namespace in other branches
- 8.2 libraries/common_syndication_parser.inc \_parser_common_syndication_link()
- 7.2 libraries/common_syndication_parser.inc \_parser_common_syndication_link()
- 7 libraries/common_syndication_parser.inc \_parser_common_syndication_link()
Extract the link that points to the original content (back to site or original article)
Parameters
$links: Array of SimpleXML objects
1 call to _parser_common_syndication_link()
- _parser_common_syndication_atom10_parse in libraries/
common_syndication_parser.inc - Parse atom feeds.
File
- libraries/
common_syndication_parser.inc, line 577 - Downloading and parsing functions for Common Syndication Parser. Pillaged from FeedAPI common syndication parser.
Code
function _parser_common_syndication_link($links) {
$to_link = '';
if (count($links) > 0) {
foreach ($links as $link) {
$link = $link
->attributes();
$to_link = isset($link["href"]) ? "{$link["href"]}" : "";
if (isset($link["rel"])) {
if ("{$link["rel"]}" == 'alternate') {
break;
}
}
}
}
return $to_link;
}