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_settings',function($data){ | |
| $data['course']['status']['seek_lock']=false; | |
| return $data; | |
| }); |
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
| steps:------------------------------------------------------------------------------------------------------------ | |
| node -version : 8.10.0 | |
| remove ionic and cordova first so that caching will not effect | |
| npm uninstall -g ionic cordova | |
| then install this version | |
| npm install -g ionic cordova |
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_expired_course_button',function($button,$course_id){ | |
| if(is_user_logged_in()){ | |
| $user_id = get_current_user_id(); | |
| $course_status = bp_course_get_user_course_status($user_id,$course_id); | |
| if($course_status == 0){ //USer subscribed but not started | |
| $init=WPLMS_tips::init(); | |
| if(!empty($init->lms_settings['calculate_course_duration_from_start_course'])){ | |
| $expiry = bp_course_get_user_expiry_time($user_id,$course_id); |
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_expired_course_button',function($button,$course_id){ | |
| if(is_user_logged_in()){ | |
| $user_id = get_current_user_id(); | |
| $course_status = bp_course_get_user_course_status($user_id,$course_id); | |
| if($course_status == 0){ //USer subscribed but not started | |
| $init=WPLMS_tips::init(); | |
| if(!empty($init->lms_settings['calculate_course_duration_from_start_course'])){ | |
| $expiry = bp_course_get_user_expiry_time($user_id,$course_id); |
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('rest_api_init',function(){ | |
| add_filter('bp_course_wplms_filters',function($args){ | |
| if(empty($args['tax_query'])){ | |
| $args['tax_query']=array( | |
| 'relation' => 'AND', | |
| array( | |
| 'taxonomy'=>'course-cat', | |
| 'field'=>'id', | |
| 'terms' =>array('xx','xx') | |
| ) |
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_registration_form_submit_button',function($return){ | |
| if(is_user_logged_in()){ | |
| $check = wc_customer_bought_product('',get_current_user_id(),XX); | |
| if($check){ | |
| return $return; | |
| } | |
| } | |
| return '<a href="'.get_permalink(XX).'">Purchase Membership $99</a>'; | |
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_custom_registration_form_user_added',function($user_id,$user_args,$settings){ | |
| $admins = get_users('role=Administrator'); | |
| $admin_emails = []; //PHP 7.2+ else change to $admin_Emails = array(); | |
| foreach ($blogusers as $user) { | |
| $admin_emails[]=$user->user_email; | |
| } | |
| $admin_emails = implode(',',$admin_emails); | |
| $subject = 'User registered in site'; | |
| $body = 'The user '.$user_args['user_email'].' registered in your site'; |
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_submit_course', 'add_a_tag_when_complete_course', 10, 2 ); | |
| function add_a_tag_when_complete_course( $course_id, $user_id ) | |
| { | |
| if($course_id !== 1500) | |
| return; | |
| $tags_to_add = [ 'Course1Complete', 'Course2Prospect' ]; | |
| $contact = \Groundhogg\Plugin::$instance->tracking->get_current_contact(); | |
| if ( ! $contact ){ | |
| return; |
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; | |
| } | |
| } |
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
| //video so app | |
| add_filter('wplms_unit_metabox',function($box){ | |
| $box[]=array( // Single checkbox | |
| 'label' => __('Unit Content for App','vibe-customtypes'), // <label> | |
| 'desc' => __('Unit Content for App.','vibe-customtypes'), // description | |
| 'id' => 'vibe_app_content', // field id and name | |
| 'type' => 'editor', // type of field | |
| 'std' => '' | |
| ); | |
| return $box; |