Created
November 5, 2018 22:21
-
-
Save zackkatz/8ec6fd324055e1e1d0ad03b0cee812c7 to your computer and use it in GitHub Desktop.
GravityView - Remove required fields from Edit Entry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityview/edit_entry/form_fields', 'gravityview_edit_entry_dont_require_fields' ); | |
/** | |
* Remove the "required" setting from Gravity Forms fields in GravityView Edit Entry | |
* | |
* @return GF_Field[] | |
*/ | |
function gravityview_edit_entry_dont_require_fields( $fields ) { | |
foreach( $fields as $key => $field ) { | |
$field->isRequired = false; | |
$fields[ $key ] = $field; | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not skilled enough to analyze the code above, but do you know if this has been updated? I have this added, but it's still requiring fields when I try to edit entries. thanks!