Reports::removeCourseFilterIfOnlyOne( $filters )

Remove the filter if only 1 option available

Description

Source

File: bp-integrations/learndash/buddypress/Reports.php

240
241
242
243
244
245
246
247
248
249
250
251
public function removeCourseFilterIfOnlyOne($filters)
{
    if (! $currentGroup = groups_get_current_group()) {
        return $filters;
    }
 
    if (count(bp_learndash_get_group_courses($currentGroup->id)) < 2) {
        unset($filters['course']);
    }
 
    return $filters;
}

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.