Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add approval statuses filter to Gravity Flow's Workflow Status page #2231

Open
rafaehlers opened this issue Dec 5, 2024 · 2 comments
Open

Comments

@rafaehlers
Copy link
Contributor

We should add this to the GV core.

image

This is the Gravity Flow filter we are using: https://docs.gravityflow.io/article/207-gravityflowfieldfiltersstatustable

Working code:

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;
}

Here's a video explaining how this works: https://www.loom.com/share/4f546ff19db74e9388ac5831358f4f90

@rafaehlers rafaehlers changed the title Add GV Approval Statuses filter to Gravity Flow's Workflow Status page Add approval statuses filter to Gravity Flow's Workflow Status page Dec 5, 2024
@rafaehlers
Copy link
Contributor Author

@verysiberian
Copy link

Yes, please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants