function xmlsitemap_menu_create_link in XML sitemap 6.2
Same name and namespace in other branches
- 7.2 xmlsitemap_menu/xmlsitemap_menu.module \xmlsitemap_menu_create_link()
Create a sitemap link from a menu item.
Parameters
$menu_item: A loaded menu item.
1 call to xmlsitemap_menu_create_link()
- xmlsitemap_menu_xmlsitemap_process_menu_links in xmlsitemap_menu/
xmlsitemap_menu.module - Process menu sitemap links.
File
- xmlsitemap_menu/
xmlsitemap_menu.module, line 181
Code
function xmlsitemap_menu_create_link(array $menu_item) {
if (!isset($menu_item['xmlsitemap'])) {
$menu_item['xmlsitemap'] = array();
if ($menu_item['mlid'] && ($link = xmlsitemap_link_load('menu_link', $menu_item['mlid']))) {
$menu_item['xmlsitemap'] = $link;
}
}
$settings = xmlsitemap_link_bundle_load('menu_link', $menu_item['menu_name']);
$menu_item['xmlsitemap'] += array(
'type' => 'menu_link',
'id' => $menu_item['mlid'],
'status' => $settings['status'],
'status_default' => $settings['status'],
'status_override' => 0,
'priority' => $settings['priority'],
'priority_default' => $settings['priority'],
'priority_override' => 0,
);
// The following values must always be checked because they are volatile.
$menu_item['xmlsitemap']['loc'] = $menu_item['link_path'];
$menu_item['xmlsitemap']['subtype'] = $menu_item['menu_name'];
$menu_item['xmlsitemap']['access'] = $menu_item['access'] && !$menu_item['external'] && !$menu_item['hidden'];
$menu_item['xmlsitemap']['language'] = isset($menu_item['options']['langcode']) ? $menu_item['options']['langcode'] : '';
return $menu_item['xmlsitemap'];
}