🐛 Render preview when enabling the button

Before this, the “is enabled” checkbox was not observed; enabling it did not cause a preview button to render, and required changing any other form field that was linked to the button

Also start to extract some logic to a new helper file.
This commit is contained in:
Philipp Stracker 2024-06-12 18:12:07 +02:00
parent 6ee4a40e18
commit c23129cb91
No known key found for this signature in database
4 changed files with 78 additions and 22 deletions

View file

@ -174,7 +174,7 @@ return array(
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
'data-ppcp-display' => wp_json_encode(
array(
$display_manager
->rule()
@ -191,6 +191,8 @@ return array(
->to_array(),
)
),
'data-ppcp-apm-name' => $apm_name,
'data-ppcp-field-name' => 'is_enabled',
),
'classes' => array( 'ppcp-valign-label-middle', 'ppcp-align-label-center' ),
),