You are here

function _parser_common_syndication_link in Feeds Atom 7

Same name and namespace in other branches
  1. 6 libraries/atomrdf_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()
atomrdf_parse in libraries/atomrdf_parser.inc
Parse AtomRDF format - for example:

File

libraries/atomrdf_parser.inc, line 499
Contains the atomrd parsing functions.

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;
}