Skip to content

Commit e41cc1b

Browse files
committed
gpeb-show-default-form-confirmations-on-edit.php: Added snippet to display default confirmations when editing entries via Entry Blocks.
1 parent 5a8881b commit e41cc1b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Entry Blocks // Show Default Form Confirmations on Edit.
4+
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
5+
*
6+
* Use confirmation message from Form Settings when editing an entry in GPEB.
7+
*
8+
* Instruction Video: https://www.loom.com/share/4bdd738bbd0342548807c2dffd93bd73
9+
*/
10+
11+
/**
12+
* @param array $confirmation The edit confirmation.
13+
* @param array $form The current form.
14+
* @param array $entry The entry being edited.
15+
*
16+
* @return string
17+
*/
18+
add_filter( 'gpeb_edit_confirmation', function ( $confirmation, $form, $entry ) {
19+
20+
// Replace with your form ID.
21+
if ( $form['id'] != 137 ) {
22+
return $confirmation;
23+
}
24+
25+
// Populates the form confirmation property with the confirmation to be used for the current submission.
26+
$form = GFFormDisplay::update_confirmation( $form, $entry );
27+
return $form['confirmation'];
28+
}, 10, 3 );

0 commit comments

Comments
 (0)