Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions gp-entry-blocks/gpeb-show-default-form-confirmations-on-edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Gravity Perks // Entry Blocks // Show Default Form Confirmations on Edit.
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
*
* Use confirmation message from Form Settings when editing an entry in GPEB.
*
* Instruction Video: https://www.loom.com/share/4bdd738bbd0342548807c2dffd93bd73
*/

/**
* @param array $confirmation The edit confirmation.
* @param array $form The current form.
* @param array $entry The entry being edited.
*
* @return string
*/
add_filter( 'gpeb_edit_confirmation', function ( $confirmation, $form, $entry ) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocker: I thiiiinkkk it's standard in the snippet library to use variables for "scoped values" such as form ids.

Suggested change
// Replace with your form ID.
$form_id = 123;

// Replace with your form ID.
if ( $form['id'] != 137 ) {
return $confirmation;
}

// Populates the form confirmation property with the confirmation to be used for the current submission.
$form = GFFormDisplay::update_confirmation( $form, $entry );
return $form['confirmation'];
}, 10, 3 );
Loading