From 31eaba11f0241da8f81a2ae6e658987ac6a2dd58 Mon Sep 17 00:00:00 2001 From: Nick Spiel Date: Wed, 14 May 2014 14:32:19 +1000 Subject: [PATCH] Added a set change frequency check. Added a check to see if user has set the `set_change_frequency` in yml config. --- code/extensions/GoogleSitemapExtension.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/extensions/GoogleSitemapExtension.php b/code/extensions/GoogleSitemapExtension.php index 57541d0..016800b 100644 --- a/code/extensions/GoogleSitemapExtension.php +++ b/code/extensions/GoogleSitemapExtension.php @@ -78,6 +78,10 @@ class GoogleSitemapExtension extends DataExtension { * @return SS_Datetime */ public function getChangeFrequency() { + if($freq = Config::inst()->get('GoogleSitemap', 'set_change_frequency')) { + return $freq; + } + if($freq = GoogleSitemap::get_frequency_for_class($this->owner->class)) { return $freq; }