You are here

public function XMLSitemapWriter::writeSitemapElement in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.xmlsitemap.inc \XMLSitemapWriter::writeSitemapElement()

Write an full XML sitemap element tag.

Parameters

string $name: The element name.

array $element: An array of the elements properties and values.

1 call to XMLSitemapWriter::writeSitemapElement()
XMLSitemapIndexWriter::generateXML in ./xmlsitemap.xmlsitemap.inc
Generate XML.

File

./xmlsitemap.xmlsitemap.inc, line 171
XML sitemap integration functions for xmlsitemap.module.

Class

XMLSitemapWriter
Extended class for writing XML sitemap files.

Code

public function writeSitemapElement($name, array &$element) {
  $this
    ->writeElement($name, $element);
  $this
    ->writeRaw(PHP_EOL);

  // After a certain number of elements have been added, flush the buffer
  // to the output file.
  $this->sitemapElementCount++;
  if ($this->sitemapElementCount % $this->linkCountFlush == 0) {
    $this
      ->flush();
  }
}