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,10 +116,11 @@ class BlockRendererHelper {
$automationId = null;
if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) {
$automationId = 'data-automation-id="form_' . $block['id'] . '_label" ';
}
if (isset($formSettings['id'])) {
$forId = 'for="form_' . $block['id'] . '_' . $formSettings['id'] . '" ';
}
}
if (
isset($block['params']['label'])

View File

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