You are here

function xmlsitemap_recalculate_changefreq in XML sitemap 7.2

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

Recalculate the changefreq of a sitemap link.

@codingStandardsIgnoreStart

Parameters

array $link: A sitemap link array.

1 call to xmlsitemap_recalculate_changefreq()
XMLSitemapUnitTest::testRecalculateChangefreq in ./xmlsitemap.test
Test for xmlsitemap_recalculate_changefreq().

File

./xmlsitemap.module, line 1360
xmlsitemap XML sitemap

Code

function xmlsitemap_recalculate_changefreq(&$link) {

  // @codingStandardsIgnoreEnd
  $link['changefreq'] = round(($link['changefreq'] * $link['changecount'] + (REQUEST_TIME - $link['lastmod'])) / ($link['changecount'] + 1));
  $link['changecount']++;
  $link['lastmod'] = REQUEST_TIME;
}