diff --git a/includes/class-gravityview-entry-approval.php b/includes/class-gravityview-entry-approval.php index ed0ec057e..2ee2c087d 100644 --- a/includes/class-gravityview-entry-approval.php +++ b/includes/class-gravityview-entry-approval.php @@ -58,6 +58,44 @@ 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' ] ); + + } + + /** + * Adds 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 ) { + $filters[] = [ + 'key' => 'is_approved', + 'text' => esc_html__( 'Approval Status', 'gk-gravityview' ), + 'preventMultiple' => false, + 'operators' => [ 'is' ], + 'values' => [ + [ + 'value' => '1', + 'text' => esc_html__( 'Approved', 'gk-gravityview' ), + ], + [ + 'value' => '2', + 'text' => esc_html__( 'Disapproved', 'gk-gravityview' ), + ], + [ + 'value' => '3', + 'text' => esc_html__( 'Unapproved', 'gk-gravityview' ), + ], + ], + ]; + + return $filters; } /** diff --git a/readme.txt b/readme.txt index d8205b3aa..92f2c9543 100644 --- a/readme.txt +++ b/readme.txt @@ -23,6 +23,9 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h = develop = +#### 🚀 Added +* Support for entry approval statuses in conditional logic on the Gravity Forms Export Entries page. + #### 🐛 Fixed * Fatal error when searching entries by approval status in Views joined with another form using the Multiple Forms extension. * Some merge tag modifiers (e.g., `maxwords`) were not being processed.