gravityflow_reports_args

Description

The gravityflow_reports_args filter allows the reports display arguments to be overridden.

Parameters

ParameterTypeDetails
$argsArrayThe reports display arguments.

The defaults for the arguments array are:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$defaults = array(
    'view'                  => rgget( 'view' ),
    'form_id'               => absint( rgget( 'form-id' ) ),
    'step_id'               => absint( rgget( 'step-id' ) ),
    'category'              => sanitize_key( rgget( 'category' ) ),
    'range'                 => $range,
    'start_date'            => $start_date,
    'assignee'              => $assignee_key,
    'assignee_type'         => $assignee_type,
    'assignee_id'           => $assignee_id,
    'check_permissions'     => true,
    'base_url'              => admin_url( 'admin.php?page=gravityflow-reports' ),
    'display_filter'        => true,
);

Examples

1
2
3
4
5
6
7
8
add_filter( 'gravityflow_reports_args', 'sh_gravityflow_reports_args', 10, 1 );
function sh_gravityflow_reports_args( $args ) {
   Remove the filter bar from the report screen for a specific form ID
   if( $args['form_id'] == '42' ) {
      $args['display_filter'] = false;
   }
   return $args;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?