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'); | |
?> |
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('login_redirect',function($redirect_url,$request_url,$user){ | |
global $bp; | |
if(($user instanceof WP_User)){ | |
if(function_exists('wplms_get_user_batches')){ | |
$batches = wplms_get_user_batches($user->ID); | |
if(!empty($batches)){ | |
return bp_get_group_permalink($batches[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
add_shortcode('wplms_quiz_top_scorers',function($atts,$content = null){ | |
extract(shortcode_atts(array( | |
'count' => 5, | |
))); | |
global $wpdb; |