Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zackkatz/0286f63a3133be95a8aecef70117775e to your computer and use it in GitHub Desktop.
Save zackkatz/0286f63a3133be95a8aecef70117775e to your computer and use it in GitHub Desktop.
GravityView - Change default entry approval status
<?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;
} );
@emmanuelsonkay
Copy link

emmanuelsonkay commented Oct 25, 2020

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.

add_filter( 'gravityview/approve_entries/after_submission/default_status', function( $default_status ) {
	return GravityView_Entry_Approval_Status::RESET;
} );

WordPress_›_Error

@zackkatz
Copy link
Author

zackkatz commented Nov 23, 2020

The default is unapproved (GravityView_Entry_Approval_Status::UNAPPROVED), so if that's not working, please contact support (support@gravityview.co).

@jasimp
Copy link

jasimp commented Jun 29, 2022

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