Skip to content

Commit fefcc22

Browse files
authored
gpb-set-blocklist-by-field-value.php: Added new snippet for setting blocklist by field value.
1 parent 3c0dc72 commit fefcc22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Blocklist // Set Blocklist by Field Value
4+
* https://gravitywiz.com/documentation/gravity-forms-blocklist/
5+
*
6+
* Video Instructions:
7+
*
8+
* Use this snippet to create a blocklist editor form.
9+
*/
10+
// Update "123" to your form ID.
11+
add_action( 'gform_after_submission_123', function( $entry, $form ) {
12+
// Update "4" to the field ID whose value should be used to set the blocklist.
13+
update_option('disallowed_keys', rgar( $entry, 4 ) );
14+
}, 10, 2 );

0 commit comments

Comments
 (0)