Created
September 9, 2021 15:33
-
-
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.
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_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