You are here

function xmlsitemap_node_xmlsitemap_links in XML sitemap 5

Same name and namespace in other branches
  1. 5.2 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_xmlsitemap_links()
  2. 6 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_xmlsitemap_links()

Implementation of hook_xmlsitemap_links().

Related topics

File

xmlsitemap_node/xmlsitemap_node.module, line 15
Adds nodes to the site map.

Code

function xmlsitemap_node_xmlsitemap_links($type = NULL, $excludes = array()) {
  $links = array();
  if (!isset($type)) {
    $links = _xmlsitemap_node_links(_xmlsitemap_node_excludes());
    $links = array_merge($links, module_invoke_all('xmlsitemap_links', 'node', _xmlsitemap_node_excludes()));
    $links = array_merge($links, module_invoke_all('gsitemap', 'node', _xmlsitemap_node_excludes()));
    if (!empty($links)) {
      foreach ($links as $key => $link) {
        $nid[$key] = $link['nid'];
        $loc[$key] = $link['#loc'];
      }
      array_multisort($nid, $loc, $links);
    }
  }
  return $links;
}