bp_ps_learndash_course_users_search( $f )

Fetch all the users from a selected course.

Description

Parameters

$f

(Required)

Return

(array)

Source

File: bp-core/profile-search/bps-xprofile.php

484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
function bp_ps_learndash_course_users_search( $f ) {
 
    // check for learndash plugin is activated or not.
    if ( in_array( 'sfwd-lms/sfwd_lms.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
 
 
        $course_id = $f->value;
        if ( isset( $course_id ) && ! empty( $course_id ) ) {
            $course_users = bp_ps_learndash_get_users_for_course( $course_id, '', false );
 
            $course_users = $course_users->results;
 
            if ( isset( $course_users ) && ! empty( $course_users ) ) {
                return $course_users;
            } else {
                return array();
            }
        } else {
            return array();
        }
    }
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

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.