Browse: Home / Functions /

learndash_get_group_leader_groups_users

learndash_get_group_leader_groups_users( int $user_id,  boolean $by_group = false,  boolean $totals_only = false )

Returns the list of user IDs managed by the group leader.


Description #


Parameters #

$user_id

(int) (Required) The group leader user ID. Default current user ID.

$by_group

(boolean) (Optional) If true, returns the user IDs by group.

Default value: false

$totals_only

(boolean) (Optional) Whether to return only the count of users.

Default value: false


Return #

(int|array<int,) int[]>|int[] It depends on the $by_group and $totals_only parameters. If $by_group is true, it returns an array of user IDs/count by group. If $totals_only is true, it returns the count of users. Otherwise, it returns an array of user IDs.


Source #

File: includes/ld-reports.php


Changelog #

Changelog
Version Description
2.1.0 Introduced.