Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Last active December 19, 2016 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrVibe/8ef9666b29e6781d6826 to your computer and use it in GitHub Desktop.
Save MrVibe/8ef9666b29e6781d6826 to your computer and use it in GitHub Desktop.
add_filter('wplms_course_credits','wplms_hide_course_credits_for_course_students',10,2);
function wplms_hide_course_credits_for_course_students($credits,$course_id){
if(!is_user_logged_in()){
return $credits;
}
$user_id = get_current_user_id();
if(wplms_user_course_check($user_id,$course_id)){
$credits = 'Subscribed'; //hide credits for course students and display "Subscribed" message
}
return $credits;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment