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 custom field | |
add_filter('vibebp_vars',function($vars){ | |
$vars['settings']['registration_fields'][]=['type'=>'text','id'=>'XXXXX','label'=>_x('WPLMS Purchase Code','login','vibebp'),'value'=>'','class'=>'input']; | |
return $vars; | |
}); | |
//Process custom field | |
add_filter('vibebp_register_user_bypass',function($flag,$body){ | |
foreach($body as $key => $value){ | |
if($value['type'] == 'password'){ |
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_creation_tabs',function($tabs,$user_id){ | |
//USER_ID , get Instructor Type | |
if(CONDITION FOR INSTRUCTOR MEMBER TYPE DETECTION) { | |
$unit_types = $tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types']; | |
foreach($unit_types as $k=>$type){ | |
if($type['id'] == 'video'){ //Match Unit Type | |
unset($unit_types[$k]); // Unset for Instructor | |
} | |
} |
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
<script> | |
document.addEventListener('appointmentSlotAdded',function(){ | |
var el = document.querySelector('.vbpcart'), | |
elClone = el.cloneNode(true); | |
el.parentNode.replaceChild(elClone, el); | |
}); | |
</script> |
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_non_loggedin_user',function($link){ | |
$link = str_replace('">','?redirect">',$link); | |
return $link; | |
}); | |
add_action( 'template_redirect', function(){ | |
if( is_single() && get_post_type() == 'product' && isset($_GET['redirect'])){ | |
global $woocommerce; | |
$found = false; | |
$product_id = get_the_ID(); | |
$courses = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_courses',false)); |
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('certificate_course_unit_timings',function($atts,$content=null){ | |
$return = ''; | |
$course_id = ; | |
$user_id = ; | |
$course_curriculum = bp_course_get_curriculum( $course_id ); | |
$unit_timing = array(); | |
$init = WPLMS_Unit_Timings_Init::Instance_WPLMS_Unit_Timings_Init(); |
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('vibebp_component_icon'function($icon,$compoent({ | |
if($id == 'wishlist'){ // Check component id , set $icon as svg | |
$icon = '<svg width="24" height="24" viewBox="0 0 24 24" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"> | |
<path d="M15.473,19.593C14.365,20.679 13.198,21.812 12,23C5.57,16.619 0,11.853 0,7.192C0,0.423 8.852,-1.154 12,4.248C15.125,-1.114 24,0.4 24,7.192C24,7.938 23.844,8.688 23.577,9.445C22.461,8.543 21.043,8 19.5,8C15.916,8 13,10.916 13,14.5C13,16.563 13.97,18.401 15.473,19.593Z" style="fill-opacity:0.6;fill-rule:nonzero;"/> | |
<path d="M19.5,10C17.017,10 15,12.015 15,14.5C15,16.985 17.017,19 19.5,19C21.983,19 24,16.985 24,14.5C24,12.015 21.983,10 19.5,10ZM22,15L20,15L20,17L19,17L19,15L17,15L17,14L19,14L19,12L20,12L20,14L22,14L22,15Z" style="fill-rule:nonzero;"/></svg>'; | |
} | |
return $icon; | |
},10,2); |
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
<script> | |
if(document.querySelector('.vibebp_profile_field.field_51')){ | |
new Promise(function(resolve){ | |
let youtube_url = document.querySelector('.vibebp_profile_field.field_51 > div').textContent; | |
let ycode = youtube_url.match(/v=([^&#]{5,})/); | |
var mdiv = document.createElement('div'); | |
mdiv.setAttribute('id','field_51_youtube'); | |
mdiv.setAttribute('data-plyr-provider','youtube'); | |
mdiv.setAttribute('data-plyr-embed-id',ycode[1]); |
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( 'template_redirect', 'vibe_product_woocommerce_direct_checkout'); | |
function vibe_product_woocommerce_direct_checkout(){ | |
if(in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) || (function_exists('vibe_check_plugin_installed') && vibe_check_plugin_installed( 'woocommerce/woocommerce.php')) || function_exists('WC')){ | |
if( is_single() && get_post_type() == 'product' && isset($_GET['redirect'])){ | |
global $woocommerce; | |
$found = false; | |
$product_id = get_the_ID(); | |
$courses = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_courses',false)); |
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('bbp_reply_is_private',function($return,$reply_id){ | |
$api = Vibe_HelpDesk_API::init(); | |
if(!empty($api->user)){ | |
$forum_id = get_post_meta($reply_id,'_bbp_forum_id',true); | |
global $wpdb; | |
$course_id = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='vibe_forum' AND meta_value = %d",$forum_id)); | |
if(!empty($course_id)){ | |
if(bp_course_is_member($course_id,$api->user->id)){ | |
return false; | |
} |
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('certificate_batch_details',function($atts,$content=null){ | |
extract(shortcode_atts(array( | |
'student_id' => '', | |
'course_id' =>'', | |
'detail'=>'0' //name, administartor, | |
), $atts)); | |
if(!isset($course_id) || !is_numeric($course_id)){ | |
$course_id=$_GET['c']; | |
} |