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; |
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(){ | |
if(is_singular('course')){ | |
?><script> | |
jQuery(document).ready(function($){ | |
if($('.course_button').attr('href').indexOf('?redirect')){ | |
$('.course_button').on('click',function(e){ | |
e.preventDefault(); | |
$.ajax({ | |
type: "POST", |
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){ | |
global $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()); | |
?> | |
<li class="<?php echo $course_classes; ?>"> | |
<div class="row"> | |
<div class="col-md-4"> |