You are here

function xmlsitemap_get_current_context in XML sitemap 8

Same name and namespace in other branches
  1. 6.2 xmlsitemap.module \xmlsitemap_get_current_context()
  2. 7.2 xmlsitemap.module \xmlsitemap_get_current_context()
  3. 2.x xmlsitemap.module \xmlsitemap_get_current_context()

Get the sitemap context of the current request.

Return value

array Current context.

Related topics

4 calls to xmlsitemap_get_current_context()
XmlSitemap::loadByContext in src/Entity/XmlSitemap.php
Returns the sitemap with the context specified as parameter.
XmlSitemapController::renderSitemapXml in src/Controller/XmlSitemapController.php
Provides the sitemap in XML format.
XmlSitemapForm::save in src/Form/XmlSitemapForm.php
Form submission handler for the 'save' action.
xmlsitemap_install in ./xmlsitemap.install
Implements hook_install().

File

./xmlsitemap.module, line 1440
xmlsitemap XML sitemap

Code

function xmlsitemap_get_current_context() {
  $context =& drupal_static(__FUNCTION__);
  if (!isset($context)) {
    $context = \Drupal::moduleHandler()
      ->invokeAll('xmlsitemap_context');
    \Drupal::moduleHandler()
      ->alter('xmlsitemap_context', $context);
    ksort($context);
  }
  return $context;
}