Skip to content

Commit 56fe961

Browse files
authored
gpnf-disable-modal-cancel-confirmation.php: Added new snippet.
1 parent 5f35dd9 commit 56fe961

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Gravity Perks // Nested Forms // Disable Modal Cancel Confirmation
3+
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/
4+
*
5+
* This snippet removes the confirmation prompt when canceling a Nested Form modal.
6+
* Normally, when a user attempts to close the modal without saving, they are asked
7+
* to confirm their action. With this snippet, the modal closes immediately.
8+
*
9+
* Instructions:
10+
*
11+
* 1. Install this snippet.
12+
* https://gravitywiz.com/documentation/managing-snippets/#where-do-i-put-snippets
13+
*/
14+
add_filter( 'gpnf_init_script_args', function( $args, $field, $form ) {
15+
$args['modalLabels']['confirmAction'] = false;
16+
return $args;
17+
}, 10, 3 );

0 commit comments

Comments
 (0)