Start processing for comments only if comments are enabled on that route

This commit is contained in:
Flavio Copes 2015-10-19 18:14:15 +02:00
parent ba09e9a865
commit 29adbc56cb
1 changed files with 6 additions and 4 deletions

View File

@ -42,10 +42,12 @@ class CommentsPlugin extends Plugin
return;
}
$header = $page->header();
if (!isset($header->form)) {
$header->form = $this->grav['config']->get('plugins.comments.form');
$page->header($header);
if ($this->enable) {
$header = $page->header();
if (!isset($header->form)) {
$header->form = $this->grav['config']->get('plugins.comments.form');
$page->header($header);
}
}
}
}