gravityflow_status_filter

The gravityflow_status_filter filter is used to constrain the entries on the status page.

Parameters

$filter_constraints array

Example

The following snippet will restrict user with the ID of 1 to the entries of form 2.

add_filter( 'gravityflow_status_filter', 'sh_gravityflow_status_filter' );
function sh_gravityflow_status_filter( $filter_constraints ) {
	$user = wp_get_current_user();
	if ( $user->ID == 1 ) {
		// The constraints are optional.
		$filter_constraints = array(
			'form_id'    => 2,
			// 'start_date' => '2016-01-01',
			// 'end_date'   => '2016-01-14',
		);
	}
	return $filter_constraints;
}

The following snippet will restrict any entries with a value of Ontario in field 9. Refer to the Gravity Forms API docs for further field filter examples.

add_filter( 'gravityflow_status_filter', 'sh_gravityflow_status_field_filter' );
function sh_gravityflow_status_field_filter( $filter_constraints ) {
	 $filter_constraints = array(
            'field_filters' => array(
                'mode' => 'all',
                array(
                    'key' => 9,
                    'operator' => 'isnot',
                    'value' => 'Ontario'
                )
            )
        );
	return $filter_constraints;
}

Placement

This code should be placed in the functions.php file of your active theme.

Still need help? Contact Support Contact Support