Skip to content

Commit

Permalink
Adds approval status to export entries conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
omarkasem committed Jan 6, 2025
1 parent 04dcd1d commit bf6b976
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions includes/class-gravityview-entry-approval.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,43 @@ private function add_hooks() {
add_action( 'gravityview/approve_entries/updated', array( $this, '_trigger_notifications' ) );

add_action( 'check_admin_referer', [ $this, 'resend_gf_notifications' ], 10, 2 );

add_filter( 'gform_field_filters', [ $this, 'add_approval_field_filter' ], 10, 2 );

}

/**
* Add approval status filter to the filter list (Export entries conditional logic)
*
* @since TBD
*
* @param array $filters The existing filters.
* @param array $form The form array.
* @return array The modified filters.
*/
public function add_approval_field_filter( $filters, $form ) {
$filters[] = array(
'key' => 'is_approved',
'text' => __( 'Approval Status', 'gk-gravityview' ),
'preventMultiple' => false,
'operators' => array( 'is' ),
'values' => array(
array(
'value' => '1',
'text' => __( 'Approved', 'gk-gravityview' ),
),
array(
'value' => '2',
'text' => __( 'Disapproved', 'gk-gravityview' ),
),
array(
'value' => '3',
'text' => __( 'Unapproved', 'gk-gravityview' ),
),
),
);

return $filters;
}

/**
Expand Down

0 comments on commit bf6b976

Please sign in to comment.