You are here

function hook_simple_sitemap_attributes_alter in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 simple_sitemap.api.php \hook_simple_sitemap_attributes_alter()
  2. 8.2 simple_sitemap.api.php \hook_simple_sitemap_attributes_alter()

Alters the sitemap attributes shortly before XML document generation. Attributes can be added, changed and removed.

Parameters

array &$attributes:

string $sitemap_variant:

1 invocation of hook_simple_sitemap_attributes_alter()
DefaultSitemapGenerator::addSitemapAttributes in src/Plugin/simple_sitemap/SitemapGenerator/DefaultSitemapGenerator.php
Adds attributes to the sitemap.

File

./simple_sitemap.api.php, line 88
Hooks provided by the Simple XML Sitemap module.

Code

function hook_simple_sitemap_attributes_alter(array &$attributes, $sitemap_variant) {

  // Remove the xhtml attribute e.g. if no xhtml sitemap elements are present.
  unset($attributes['xmlns:xhtml']);
}