You are here

function hook_xmlsitemap_context_alter in XML sitemap 2.x

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

Alter the current context information.

See also

hook_xmlsitemap_context()

1 invocation of hook_xmlsitemap_context_alter()
xmlsitemap_get_current_context in ./xmlsitemap.module
Get the sitemap context of the current request.

File

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

Code

function hook_xmlsitemap_context_alter(&$context) {
  $currentUser = \Drupal::currentUser();
  if ($currentUser
    ->hasPermission('administer taxonomy')) {
    unset($context['vocabulary']);
  }
}