Add label and id also to custom fields

[MAILPOET-3331]
This commit is contained in:
Brezo Cordero
2022-06-05 18:57:55 -05:00
committed by Veljko V
parent 6ad442a5dc
commit 57f6d54fdf
2 changed files with 7 additions and 7 deletions

View File

@@ -116,9 +116,10 @@ class BlockRendererHelper {
$automationId = null; $automationId = null;
if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) { if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) {
$automationId = 'data-automation-id="form_' . $block['id'] . '_label" '; $automationId = 'data-automation-id="form_' . $block['id'] . '_label" ';
if (isset($formSettings['id'])) { }
$forId = 'for="form_' . $block['id'] . '_' . $formSettings['id'] . '" ';
} if (isset($formSettings['id'])) {
$forId = 'for="form_' . $block['id'] . '_' . $formSettings['id'] . '" ';
} }
if ( if (

View File

@@ -42,12 +42,11 @@ class Text {
} }
if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) { if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) {
$automationId = 'data-automation-id="form_' . $this->wp->escAttr($block['id']) . '" '; $automationId = 'data-automation-id="form_' . $this->wp->escAttr($block['id']) . '" ';
}
if (isset($formSettings['id'])) { if (isset($formSettings['id'])) {
$id = 'id="form_' . $this->wp->escAttr($block['id']) . '_' . $this->wp->escAttr($formSettings['id']) . '" '; $id = 'id="form_' . $this->wp->escAttr($block['id']) . '_' . $this->wp->escAttr($formSettings['id']) . '" ';
}
} }
$styles = $this->inputStylesRenderer->renderForTextInput($block['styles'] ?? [], $formSettings); $styles = $this->inputStylesRenderer->renderForTextInput($block['styles'] ?? [], $formSettings);