gravityflowchecklists_checklists

Description

The  gravityflowchecklists_checklists filter allows the checklist configurations to be filtered.

Parameters

ParameterTypeDetails
$checklist_configs ArrayThe array of checklist configurations.
$userWP UserThe user

Examples

Prevent entries from form with the ID of 1 from being presented in the status page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
add_filter( 'gravityflowchecklists_checklists', 'sh_filter_gravityflowchecklists_checklistss', 10, 2 );
/**
 * Adds a checklist.
 *
 * @param array        $checklist_configs
 * @param WP_user|null $user
 *
 * @return array
 */
function sh_filter_gravityflowchecklists_checklists( $checklist_configs, $user ) {
    $checklist_configs[] = array(
        'id'          => 'admissions',
        'name'        => 'Admissions',
        'nodes'       => array(
            array(
                'id'                      => 'Syx2IrAKTW',
                'form_id'                 => '11',
                'custom_label'            => '',
                'waitForWorkflowComplete' => false,
                'linkToEntry'             => true,
            ),
            array(
                'id'                      => 'HyKDSCF6Z',
                'form_id'                 => '12',
                'custom_label'            => '',
                'waitForWorkflowComplete' => false,
                'linkToEntry'             => true,
            ),
            array(
                'id'                      => 'Symn6r96Z',
                'form_id'                 => '14',
                'custom_label'            => '',
                'waitForWorkflowComplete' => true,
                'linkToEntry'             => true,
            ),
        ),
        'sequential'  => true, // true, false
        'permissions' => 'all', // 'all' or 'select'. If 'select' then the 'assignees' element is required
        'assignees'   => array(
            'user_id|1',
        ),
    );
 
    return $checklist_configs;
}

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?