Browse: Home / Hooks /

learndash_get_user_groups_courses_ids

apply_filters( 'learndash_get_user_groups_courses_ids',  array $user_group_course_ids,  int $user_id )

Filters the list of user group courses.


Description #


Parameters #

$user_group_course_ids

(array) An array of found user group courses.

$user_id

(int) User ID.


Source #

File: includes/ld-users.php


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
/**
 * Example usage for learndash_get_user_groups_courses_ids filter.
 */
add_filter(
    'learndash_get_user_groups_courses_ids',
    function( $user_group_course_ids, $user_id ) {
        // May add any custom logic using $user_group_course_ids, $user_id.
 
        // Always return $user_group_course_ids.
        return $user_group_course_ids;
    },
    10,
    2
);