To implement a custom user task using hooks with Bulk Task Editor register the task:
add_action( 'rewbe_user_actions', function($actions){
$actions[] = array(
'label' => 'Name of your task',
'id' => 'bulk_task_name',
'fields' => array(
array(
'name' => 'var_1',
'type' => 'select',
'options' => array(
'value_1' => 'Option 1',
'value_2' => 'Option 2',
'value_3' => 'Option 3',
),
),
array(
'name' => 'var_2',
'type' => 'text',
),
),
);
return $actions;
},10,1);
Add the callback function of your task:
add_action('rewbe_do_user_{bulk_task_name}',function($user,$args){
if( !empty($args['var_1']) && !empty($args['var_2']) ){
$var_1 = sanitize_title($args['var_1']);
$var_2 = sanitize_text_field($args['var_2']);
// your logic here
}
return $user;
},10,2);