ok, I figured it out by myself.
Basically going into the functions i got into get_group_tree() and get_group_tree() functions and starting from that i created this:
function load_checkbox_field_choices( $field ) {
// reset choices
global $wpdb;
$group_table = _groups_get_tablename( 'group' );
$root_groups = $wpdb->get_results( "SELECT group_id FROM $group_table WHERE parent_id IS NULL" );
$group = array();
foreach($root_groups as $gruppo){
$grouped = Groups_Group::read( $gruppo->group_id );
$group[$grouped->group_id] = $grouped->name;
}
$field['choices'] = $group;
// return the field
return $field;
}
I hope i helped someone.
If anyone has a more “good looking” code I’m gladly to see it.
Hey there,
That’s great, I’m glad you worked this out.
Kind regards,
George