You are here

function hook_xmlsitemap_link_info in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap.api.php \hook_xmlsitemap_link_info()
  2. 6.2 xmlsitemap.api.php \hook_xmlsitemap_link_info()
  3. 7.2 xmlsitemap.api.php \hook_xmlsitemap_link_info()

Provide information on the type of links this module provides.

See also

hook_entity_info()

hook_entity_info_alter()

2 functions implement hook_xmlsitemap_link_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

xmlsitemap_custom_xmlsitemap_link_info in xmlsitemap_custom/xmlsitemap_custom.module
Implements hook_xmlsitemap_link_info().
xmlsitemap_xmlsitemap_link_info in ./xmlsitemap.module
Implements hook_xmlsitemap_link_info().
1 invocation of hook_xmlsitemap_link_info()
xmlsitemap_get_link_info in ./xmlsitemap.module
Returns information about supported sitemap link types.

File

./xmlsitemap.api.php, line 21
Hooks provided by the XML sitemap module.

Code

function hook_xmlsitemap_link_info() {
  return [
    'mymodule' => [
      'label' => 'My module items',
      // If your items can be grouped into unique "bundles", add the following
      // information.
      'bundle label' => t('Subtype name'),
      'bundles' => [
        'mysubtype1' => [
          'label' => t('My subtype 1'),
          'xmlsitemap' => [
            'status' => XMLSITEMAP_STATUS_DEFAULT,
            'priority' => XMLSITEMAP_PRIORITY_DEFAULT,
          ],
        ],
      ],
      'xmlsitemap' => [
        // Callback function to take an array of IDs and save them as sitemap
        // links.
        'process callback' => 'mymodule_xmlsitemap_process_links',
        // Callback function used in batch API for rebuilding all links.
        'rebuild callback' => 'mymodule_xmlsitemap_rebuild_links',
        // Callback function called from the XML sitemap settings page.
        'settings callback' => 'mymodule_xmlsitemap_settings',
      ],
    ],
  ];
}