timeagency
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Groups] List of Groupsok, I figured it out by myself.
Basically going into the functions i got intoget_group_tree()andget_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.it works thank you so much!
I’ve done that but i don’t see any function or data on the page that tells me what users or roles are able to see that.
I need that in a PHP function of mine and cannot find a way out.
Viewing 3 replies - 1 through 3 (of 3 total)