Created
January 18, 2021 20:18
-
-
Save marktenney/4b1919cca186bcfd751cf78d725102ae to your computer and use it in GitHub Desktop.
Filter Beaver Builder Posts Module to Display User Enrolled Courses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fl_builder_loop_query_args_filter( $query_args ) { | |
$current_user = get_user_by( 'id', $atts['user_id'] ); | |
$user_courses = ld_get_mycourses( $atts['user_id'], $atts ); | |
if ( 'enrolled-courses' == $query_args['settings']->id ) { | |
$query_args['id'] = $user_courses; | |
} | |
return $query_args; | |
} | |
add_filter( 'fl_builder_loop_query_args', 'fl_builder_loop_query_args_filter' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment