protected function DefaultSitemapGenerator::addSitemapAttributes in Simple XML sitemap 8.3
Same name and namespace in other branches
- 4.x src/Plugin/simple_sitemap/SitemapGenerator/DefaultSitemapGenerator.php \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\DefaultSitemapGenerator::addSitemapAttributes()
Adds attributes to the sitemap.
1 call to DefaultSitemapGenerator::addSitemapAttributes()
- DefaultSitemapGenerator::getXml in src/
Plugin/ simple_sitemap/ SitemapGenerator/ DefaultSitemapGenerator.php - Generates and returns a sitemap chunk.
File
- src/
Plugin/ simple_sitemap/ SitemapGenerator/ DefaultSitemapGenerator.php, line 66
Class
- DefaultSitemapGenerator
- Class DefaultSitemapGenerator @package Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator
Namespace
Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGeneratorCode
protected function addSitemapAttributes() {
$attributes = self::$attributes;
if (!$this
->isHreflangSitemap()) {
unset($attributes['xmlns:xhtml']);
}
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler
->alter('simple_sitemap_attributes', $attributes, $sitemap_variant);
foreach ($attributes as $name => $value) {
$this->writer
->writeAttribute($name, $value);
}
}