Hide recaptcha in manage subscription form
[MAILPOET-3459]
This commit is contained in:
@ -58,11 +58,14 @@ class Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderBlocks(array $blocks = [], array $formSettings = [], bool $honeypotEnabled = true): string {
|
public function renderBlocks(array $blocks = [], array $formSettings = [], bool $honeypotEnabled = true, bool $captchaEnabled = true): string {
|
||||||
// add honeypot for spambots
|
// add honeypot for spambots
|
||||||
$html = ($honeypotEnabled) ? $this->renderHoneypot() : '';
|
$html = ($honeypotEnabled) ? $this->renderHoneypot() : '';
|
||||||
foreach ($blocks as $key => $block) {
|
foreach ($blocks as $key => $block) {
|
||||||
if ($block['type'] === FormEntity::SUBMIT_BLOCK_TYPE && $this->settings->get('captcha.type') === Captcha::TYPE_RECAPTCHA) {
|
if ($captchaEnabled
|
||||||
|
&& $block['type'] === FormEntity::SUBMIT_BLOCK_TYPE
|
||||||
|
&& $this->settings->get('captcha.type') === Captcha::TYPE_RECAPTCHA
|
||||||
|
) {
|
||||||
$html .= $this->renderReCaptcha();
|
$html .= $this->renderReCaptcha();
|
||||||
}
|
}
|
||||||
if (in_array($block['type'], [FormEntity::COLUMN_BLOCK_TYPE, FormEntity::COLUMNS_BLOCK_TYPE])) {
|
if (in_array($block['type'], [FormEntity::COLUMN_BLOCK_TYPE, FormEntity::COLUMNS_BLOCK_TYPE])) {
|
||||||
|
@ -85,7 +85,7 @@ class ManageSubscriptionFormRenderer {
|
|||||||
'email' => $subscriber->email,
|
'email' => $subscriber->email,
|
||||||
'token' => $this->linkTokens->getToken($subscriber),
|
'token' => $this->linkTokens->getToken($subscriber),
|
||||||
'editEmailInfo' => __('Need to change your email address? Unsubscribe here, then simply sign up again.', 'mailpoet'),
|
'editEmailInfo' => __('Need to change your email address? Unsubscribe here, then simply sign up again.', 'mailpoet'),
|
||||||
'formHtml' => $this->formRenderer->renderBlocks($form, [], $honeypot = false),
|
'formHtml' => $this->formRenderer->renderBlocks($form, [], $honeypot = false, $captcha = false),
|
||||||
'formState' => $formState,
|
'formState' => $formState,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user