Our WP/Learndash group leaders may be administering any of several groups they are a member of. In the context, related here, they have already logged in to the WP site and chosen a group from a drop-down they wish to work with/administer.
How can I determine the group_id they are currently working with? I have successfully tested the learndash_get_users_group_ids( $user_id )
to get a list of groups they can administer, but have NO clue how to get the current $group_id
they are currently administering. Any help?
The function cited above works as expected (list of group_ids), but I've had no luck finding the correct function or method in the Learndash documentation or help site getting the one thing I so badly need: just the $group_id
(or similar) for the one group they are administering 'now'
$mygroup = \uncanny_learndash_groups\GroupManagementInterface::$ulgm_current_managed_group_id;
The above gets the correct value in $mygroup
OK, but only works in the context of being a logged-in admin - if you are not an admin, the method does nothing.