Fix display under pages

[MAILPOET-2639]
This commit is contained in:
Pavel Dohnal
2020-02-05 10:40:51 +01:00
committed by Jack Kitterhing
parent 1a1099013e
commit fd33a53d50

View File

@ -39,7 +39,7 @@ class DisplayFormInWPContent {
private function shouldDisplay(): bool {
// this code ensures that we display the form only on a page which is related to single post
if (!$this->wp->isSingle()) return false;
if (!$this->wp->isSingle() && !$this->wp->isPage()) return false;
$cache = $this->wp->getTransient(DisplayFormInWPContent::NO_FORM_TRANSIENT_KEY);
if (isset($cache[$this->wp->getPostType()])) return false;
return true;