Generate ids for form locations
This commit is contained in:
@@ -134,11 +134,25 @@ final class Addon extends GFAddOn {
|
||||
public function submit_button(string $button_input, array $form): string {
|
||||
if (!Settings::is_connected() || !$this->is_enabled($form)) return $button_input;
|
||||
if ((is_admin() && !defined('DOING_AJAX')) || GFCommon::is_form_editor()) return $button_input;
|
||||
|
||||
$id = sprintf(
|
||||
'gform_cap_%d',
|
||||
absint(rgar($form, 'id'))
|
||||
);
|
||||
|
||||
ob_start();
|
||||
Widget::render();
|
||||
Widget::render([
|
||||
'id' => $id,
|
||||
]);
|
||||
$button_input = ob_get_clean() . $button_input;
|
||||
if (Settings::is_widget_floating()) $button_input = Widget::set_button_floating($button_input);
|
||||
if (Settings::is_widget_floating()) {
|
||||
$button_input = Widget::set_button_floating(
|
||||
$button_input,
|
||||
[
|
||||
'id' => $id,
|
||||
]
|
||||
);
|
||||
}
|
||||
return $button_input;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user