Core::bp_get_course_members( $course_id )
Description
Source
File: bp-integrations/learndash/core/Core.php
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | public function bp_get_course_members( $course_id ) { $post = get_post( $course_id ); if ( empty ( $post ) ) { return array (); } $access_list = learndash_get_course_meta_setting( $post ->ID, 'course_access_list' ); if ( ! is_array ( $access_list ) ) { $access_list = array (); } $result = array (); if ( ! empty ( $access_list ) ) { $result = array (); foreach ( $access_list as $user_id ) { $user = get_userdata( (int) $user_id ); if ( empty ( $user ) || ! $user ->exists() ) { continue ; } if ( is_multisite() && ! is_user_member_of_blog( $user ->ID ) ) { continue ; } $result [] = $user ; } } return $result ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.