Skip to content

Commit 35de431

Browse files
Idealienclaygriffiths
authored andcommitted
gflow-force-read-only-not-editable-on-user-input-step.php: Added snippet to prevent Read Only fields from being editable during Gravity Flow User Input Step.
1 parent 7b4b090 commit 35de431

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Gravity Forms // Gravity Flow // Force Read Only Fields to not be editable on User Input Step
4+
* https://gravitywiz.com/
5+
*/
6+
add_filter( 'gravityflow_editable_fields_user_input', function( $editable_fields, $step ) {
7+
foreach ( $editable_fields as $key => $potential ) {
8+
$field = GFFormsModel::get_field( $step->get_form_id(), $potential );
9+
//Use cases may also want to evaluate $field['isRequired']
10+
if ( $field['gwreadonly_enable'] ) {
11+
unset( $editable_fields[ $key ] );
12+
}
13+
}
14+
15+
return $editable_fields;
16+
}, 10, 2 );

0 commit comments

Comments
 (0)