Update DisplayFormInWPContent::display method type and add more tests
MAILPOET-4885 MAILPOET-4820
This commit is contained in:
committed by
Aschepikov
parent
62325dc096
commit
0019ad110e
@@ -87,7 +87,7 @@ class DisplayFormInWPContent {
|
||||
* @param mixed $content
|
||||
* @return string|mixed
|
||||
*/
|
||||
public function display($content = null) {
|
||||
private function display($content = null) {
|
||||
if (!is_string($content) || !$this->shouldDisplay()) return $content;
|
||||
|
||||
$forms = $this->getForms();
|
||||
@@ -125,6 +125,7 @@ class DisplayFormInWPContent {
|
||||
// this code ensures that we display the form only on a page which is related to single post
|
||||
if (!$this->wp->isSingle() && !$this->wp->isPage()) $result = $this->wp->applyFilters('mailpoet_display_form_is_single', false);
|
||||
|
||||
// Ensure form does not show up multiple times when called from the woocommerce_product_loop_end filter
|
||||
if ($this->inWooProductLoop) $result = $this->displayFormInProductListPage();
|
||||
|
||||
$noFormsCache = $this->wp->getTransient(DisplayFormInWPContent::NO_FORM_TRANSIENT_KEY);
|
||||
|
Reference in New Issue
Block a user