In the same page, I have two form : one for contact with elementor widget form and the second with elementor widget Acy for newsletter.
With
if ($widget->get_id()) {
$fields = ['' => ''];
foreach ($widget->get_data('settings')['form_fields'] as $field) {
$fields[$field['custom_id']] = $field['field_label'];
}
$widget->start_controls_section('section_acymailing', [
'label' => 'AcyMailing',
'condition' => [
'submit_actions' => $this->get_name(),
],
]);
Warning: Undefined array key "field_label" in /home/wp-content/plugins/acymailing/wpinit/elementorForm.php on line 25
it's ok with
if ($widget->get_id() === 'acym_module_formAcym70581') {
$fields = ['' => ''];
foreach ($widget->get_data('settings')['form_fields'] as $field) {
$fields[$field['custom_id']] = $field['field_label'];
}
$widget->start_controls_section('section_acymailing', [
'label' => 'AcyMailing',
'condition' => [
'submit_actions' => $this->get_name(),
],
]);
}
But I think it's not very clean