Last active
May 6, 2020 04:31
-
-
Save MrVibe/d2ee359cef0b0f4b607015af5fdf7a46 to your computer and use it in GitHub Desktop.
Disable course retakes once the user passes the course and gets course certificate
This file contains hidden or 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
add_filter('wplms_course_retake_count',function($count,$course_id,$user_id){ | |
$status = bp_course_get_user_course_status($user_id,$course_id); | |
if($status == 4){ | |
$marks = bp_course_get_marks($user_id,$course_id); | |
$passing_per = get_post_meta($id,'vibe_course_passing_percentage',true); | |
if($marks > $passing_per){ | |
return 0; | |
} | |
} | |
return $count; | |
},999,3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment