Description
The gravityflowchecklists_checklists filter allows the checklist configurations to be filtered.
Parameters
Parameter | Type | Details |
---|---|---|
$checklist_configs | Array | The array of checklist configurations. |
$user | WP User | The user |
Examples
Prevent entries from form with the ID of 1 from being presented in the status page.
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?