You are here

function xmlsitemap_user_xmlsitemap_links in XML sitemap 5

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

Implementation of hook_xmlsitemap_links().

Related topics

File

xmlsitemap_user/xmlsitemap_user.module, line 15
Adds user profiles to the site map.

Code

function xmlsitemap_user_xmlsitemap_links($type = NULL, $excludes = array()) {
  $links = array();
  if (!isset($type) && user_access('access user profiles')) {
    $links = _xmlsitemap_user_links();
    $links = array_merge($links, module_invoke_all('xmlsitemap_links', 'user'));
    $links = array_merge($links, module_invoke_all('gsitemap', 'user'));
    if (!empty($links)) {
      foreach ($links as $key => $link) {
        $uid[$key] = $link['uid'];
        $loc[$key] = $link['#loc'];
      }
      array_multisort($uid, $loc, $links);
    }
  }
  return $links;
}