Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Created September 9, 2021 15:33
Show Gist options
  • Save MrVibe/25c4bbb338ba1d8c79c5e0f473ab7a6b to your computer and use it in GitHub Desktop.
Save MrVibe/25c4bbb338ba1d8c79c5e0f473ab7a6b to your computer and use it in GitHub Desktop.
Disable Course application mode when 10 applications are recieved. Applications is disabled and Course returns to previous pricing mode which was set.
add_action('wplms_user_course_application',function($course_id){
global $wpdb;
$count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->usermeta} WHERE meta_key = 'apply_course$course_id'");
if($count >=10){
update_post_meta($course_id,'vibe_course_apply','H'); //Disable Course Applications, returns to previous pricing mode.
}
},10,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment