function _parser_common_syndication_link in FeedAPI 6
Same name and namespace in other branches
- 5 parser_common_syndication/parser_common_syndication.module \_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 parser_common_syndication/
parser_common_syndication.inc - Parse atom feeds.
File
- parser_common_syndication/
parser_common_syndication.inc, line 738 - Downloading and parsing functions for 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;
}