Skip to content

Commit 7b4b3c5

Browse files
authored
gpepee-conditional-edit.php: Migrated from experimental folder.
1 parent e21b59b commit 7b4b3c5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Easy Passthrough Edit Entry // Conditional Edit
4+
* https://gravitywiz.com/edit-gravity-forms-entries-on-the-front-end/
5+
*
6+
* Experimental Snippet 🧪
7+
*
8+
* Create a field on your form and check for a specific value on that field to determine if the passed
9+
* through entry should be edited or if a new entry should be created.
10+
*/
11+
// Update "123" to the form you are using to edit entries.
12+
add_filter( 'gpepee_edit_entry_id_123', function( $update_entry_id, $form_id ) {
13+
// Update "4" to the field ID you want to check the value of.
14+
if ( rgpost( 'input_4' ) === 'Add New' ) {
15+
$update_entry_id = false;
16+
}
17+
return $update_entry_id;
18+
}, 10, 2 );

0 commit comments

Comments
 (0)