Last active
June 29, 2022 06:37
-
-
Save zackkatz/0286f63a3133be95a8aecef70117775e to your computer and use it in GitHub Desktop.
GravityView - Change default entry approval status
This file contains hidden or 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 | |
/** | |
* When a new entry is created in Gravity Forms, set the default status to Approved | |
* | |
* Note: Requires GravityView 2.0.14 or newer | |
* | |
* @return int The value for "Approved" status is 3 | |
*/ | |
add_filter( 'gravityview/approve_entries/after_submission/default_status', function( $default_status ) { | |
return GravityView_Entry_Approval_Status::APPROVED; | |
} ); |
The default is unapproved (GravityView_Entry_Approval_Status::UNAPPROVED
), so if that's not working, please contact support ([email protected]).
is there any way to change the text like UNAPPROVED => Pending
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this snippet, however, it throws a fatal error upon form submission when I change the status to RESET to have it set the approval status to unapproved, I have tried UNAPPROVED but it doesn't work.