Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Last active December 5, 2024 18:19
Show Gist options
  • Save rafaehlers/87fbc31676ff2d72b9a97549c7a93fea to your computer and use it in GitHub Desktop.
Save rafaehlers/87fbc31676ff2d72b9a97549c7a93fea to your computer and use it in GitHub Desktop.
Filtering entries by GravityView's Approval Statuses on Gravity Flow's Workflow Status page
add_filter( 'gravityflow_field_filters_status_table', 'field_filters_status_expired', 10, 1 );
function field_filters_status_expired( $field_filters ) {
foreach ( $field_filters as $form => $filters ) {
if ( $form == '185' ) { // CHANGE 185 WITH YOUR FORM ID
$field_filters[ $form ][] = array(
'key' => 'is_approved',
'text' => 'View Approval Status',
'operators' => array ( 'is', 'isnot' ),
'values' => array(
array( 'value' => '1', 'text' => 'Approved' ),
array( 'value' => '2', 'text' => 'Disapproved' ),
array( 'value' => '3', 'text' => 'Unapproved' )
),
);
}
}
return $field_filters;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment