NEW Only add comments to SiteTree objects if needed

This commit is contained in:
Aram Balakjian 2015-03-23 16:59:05 +00:00
parent 2a20037e49
commit 99cf501393
2 changed files with 10 additions and 4 deletions

View File

@ -26,6 +26,6 @@
* consult the Commenting class.
*/
if(class_exists('SiteTree') && !Commenting::has_commenting('SiteTree')) {
if(Config::inst()->get('Commenting', 'sitetree_comments') && class_exists('SiteTree') && !Commenting::has_commenting('SiteTree')) {
Commenting::add('SiteTree');
}

View File

@ -19,6 +19,12 @@ class Commenting {
*/
private static $enabled_classes = array();
/**
* @config
* @var bool Whether to enable commenting on SiteTree objects by default
*/
private static $sitetree_comments = true;
/**
* @var array default configuration values
*/