You are here

function xmlsitemap_get_changefreq in XML sitemap 2.x

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

Determine the frequency of updates to a link.

Parameters

int $interval: An interval value in seconds.

Return value

string A string representing the update frequency according to the sitemaps.org protocol.

3 calls to xmlsitemap_get_changefreq()
XmlSitemapCustomListController::render in xmlsitemap_custom/src/Controller/XmlSitemapCustomListController.php
Renders a list with all custom links.
XmlSitemapGenerator::generateChunk in src/XmlSitemapGenerator.php
Generates one chunk of the sitemap.
XmlSitemapUnitTest::testGetChangefreq in tests/src/Functional/XmlSitemapUnitTest.php
Tests for xmlsitemap_get_changefreq().

File

./xmlsitemap.module, line 995
xmlsitemap XML sitemap

Code

function xmlsitemap_get_changefreq($interval) {
  if ($interval <= 0 || !is_numeric($interval)) {
    return FALSE;
  }
  foreach (xmlsitemap_get_changefreq_options() as $value => $frequency) {
    if ($interval <= $value) {
      return $frequency;
    }
  }
  return 'never';
}