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('bp_course_single_item_view',function($flag,$post){ | |
| $course_post_id = $post->ID; | |
| $course_author= $post->post_author; | |
| $course_classes = apply_filters('bp_course_single_item','course_single_item course_id_'.$post->ID.' course_status_'.$post->post_status.' course_author_'.$post->post_author,get_the_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('bp_get_course_check_course_complete',function($course_id,$user_id){ | |
| add_filter('bp_course_get_course_curriculum',function($curriculum,$course_id){ | |
| global $wpdb; | |
| $quiz_ids = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key ='vibe_quiz_course' AND meta_value = %d",$course_id)); | |
| if(!empty($quiz_ids)){ | |
| foreach($quiz_ids as $quiz_id){ | |
| if(array_search($quiz_id, $curriculum) === false){ | |
| $curriculum[]=$quiz_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
| //USage : [wplms_student_certifiacate_badge_count type='certificate'] [wplms_student_certifiacate_badge_count type='badge'] | |
| //optionally mention user_id | |
| add_shortcode('wplms_student_certifiacate_badge_count',function($atts,$content){ | |
| if(empty($atts['user_id'])){ | |
| if(is_user_logged_in()){ | |
| $atts['user_id] = get_current_user_id(); | |
| }else{ | |
| 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_email_schedule',function($settings){ | |
| foreach($settings as $i=>$setting){ | |
| if($setting['name']==='expire_schedule'){ | |
| $hours = 30*24; | |
| $settings[$i]['options'][$hours]='Before 30 days of course expiry'; | |
| $settings[$i]['options'][$hours*2]='Before 60 days of course expiry'; | |
| $settings[$i]['options'][$hours*3]='Before 90 days of course expiry'; | |
| } | |
| } |
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('bp_signup_validate', 'eu_terms_conditions_validation'); | |
| add_action('bp_before_registration_submit_buttons', 'eu_show_terms_conditions',1,1); | |
| function eu_terms_conditions_validation(){ | |
| global $bp; | |
| $custom_field = $_POST['eu_terms_conditions']; | |
| if (empty($custom_field) || $custom_field == '') { | |
| //ERROR MESSAGE | |
| $bp->signup->errors['eu_terms_conditions'] = __('Please Check EU Terms & Conditions','vibe-customtypes'); |
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_details_array',function($details){ | |
| $details['unit_duration'] = array( | |
| 'label'=>_x('Course Offline/Online Status','label in details array','vibe-customtypes'), | |
| 'callback'=> 'custom_get_course_offline_online_status', | |
| ); | |
| return $details; | |
| }); | |
| function custom_get_course_offline_online_status(){ |
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
| .unit_wrap .fitvids { | |
| margin: 0 calc(-10% - 50px); | |
| }.unit_wrap,.unit_content{overflow:visible;} |
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('vibe_builder_thumb_styles',function($thumb_array){ | |
| $thumb_array['custom_block']= 'https://i1.wp.com/i.imgur.com/gxrPvvJ.jpg?zoom=2&w=920'; | |
| return $thumb_array; | |
| }); | |
| add_filter('vibe_featured_thumbnail_style',function($thumbnail_html,$post,$style){ | |
| if($style == 'custom_block' && $post->post_type == 'course'){ //Custom block is the same name as added for the thumbnail in pagebuilder | |
| $thumbnail_html =''; | |
| $thumbnail_html .= '<div class="block customblock">'; |
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('wp_footer',function(){ | |
| ?> | |
| <script> | |
| jQuery(document).ready(function($){ | |
| if($('body').hasClass('page-template-start-php')){ | |
| $('#watupro_quiz').each(function(){ | |
| let unit_id = $('.unit_line.active .unit').attr('data-unit'); | |
| $(this).next('form').append('<input type="hidden" name="no_ajax_course_id" value="'+$('#course_id').val()+'" /><input type="hidden" name="hash" value="'+$('#hash').val()+'" /><input type="hidden" name="load_unit" value="'+unit_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('bp_before_member_course_content',array('wplms_announcement','check_announcements')); | |
| add_action('bp_before_member_course_content',function(){ | |
| wp_nonce_field( 'vibe_security', 'security'); | |
| ?> |