Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Created February 28, 2023 18:16
Show Gist options
  • Save rafaehlers/7b61f2fd30c9069dc21ea96165bec1a4 to your computer and use it in GitHub Desktop.
Save rafaehlers/7b61f2fd30c9069dc21ea96165bec1a4 to your computer and use it in GitHub Desktop.
GravityView filters for entry approval
<?php // DO NOT COPY THIS LINE
add_action( 'gravityview/approve_entries/disapproved', 'gv_custom_function',10,1);
add_action( 'gravityview/approve_entries/unapproved', 'gv_custom_function',10,1);
add_action( 'gravityview/approve_entries/updated', 'gv_custom_function',10,1);
add_action( 'gravityview/approve_entries/approved', 'gv_custom_function',10,1);
function gv_custom_function($entry_id){
$entry = GFAPI::get_entry( $entry_id );
$form = GFAPI::get_form( $entry['form_id'] );
if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
return;
}
// YOUR CODE HERE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment