Hi,
Now in EE3 the cp_members_validate_members is a bit hard to use.
The hook has no parameters and there is no easy way to know which member(s) where actually validated.
It would be great if an array of member_id’s could be passed.
The way i do it now just seems unnecessary and error-prone.
$ids = array();
$last_segment = end(ee()->uri->segments);
if (isset($_POST['selection']) && ee()->input->post('bulk_action') == 'approve') {
if (is_array($_POST['selection'])) {
$ids = ee()->input->post('selection');
}
} else {
if (ctype_digit($last_segment)) {
$ids[] = $last_segment;
}
}
A perfect example is member_register_validate_members, it does give you the member_id.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.