Skip to content

Instantly share code, notes, and snippets.

@MrVibe
MrVibe / book_test
Last active November 2, 2020 08:11
book_test
add_shortcode('isotope',function($atts,$content=null){
wp_enqueue_script('isotope-js','https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js',array(),true);
$query = new WP_Query(array(
'post_type'=>'post',
'posts_per_page'=>9
));
@MrVibe
MrVibe / Customizer_css
Created October 25, 2020 15:44
Show numbers in practice questions : https://prnt.sc/v6ht47
.pratice_questions >div:before {
content: attr(data-question);
margin-top: 20px;
position: absolute;
right: 20px;
font-size: 2rem;
opacity:0.5;
}
.pratice_questions >div {
<html>
<head>
<title>Assignment 2 Flexbox</title>
<style>
:root{
--border:rgba(0,0,0,0.1);
--background:#fff;
--shadow:rgba(0,0,0,0.2);
}
.container {
@MrVibe
MrVibe / functions.php
Created September 30, 2020 04:21
ReOrder Zoom meeting Tabs
add_filter('vibe_zoom_script_args',function($tabs){
$tabs['shared_tabs']=array(
'course'=>_x('Course','vibe-zoom'),
'shared'=>_x('Shared ','vibe-zoom'),
'group'=>_x('Group','vibe-zoom'),
);
return $tabs;
});
@MrVibe
MrVibe / functions.php
Created September 28, 2020 00:10
Custom Component icons in WPLMS
add_filter('wplms_get_element_icon',function($icon,$component_name){
//print_r($component_name); //find out component names
if($component_name == 'jitsi'){
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather feather-video"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>';
}
return $icon;
},10,2);
@MrVibe
MrVibe / functions.php
Last active September 16, 2020 15:18
Add custom tabs in Zoom meeting v4
add_filter('vibe_zoom_script_args',function($args){
$args['shared_tabs']['custom_key']='Membership Tab'; //Show in Tabs
$args['shared_types']['custom_key']='Membership Level'; //For assigning while creating meeting
return $args;
});
add_filter('vibe_zoom_search_sharing_values',function($return,$request,$user){
$args = json_decode($request->get_body(),true);
@MrVibe
MrVibe / funtions.php
Created September 2, 2020 15:38
Translating strings via code https://prnt.sc/uac7nk
add_filter('wplms-zoom_script_args',function($args){
$args['sorters']['date']='XXX';
$args['sorters']['name']='YYY';
$args['shared_types']['shared']='AAA';
$args['shared_types']['group']='BBB';
$args['shared_types']['course']='CCC';
return $args;
});
@MrVibe
MrVibe / functions.php
Created July 21, 2020 10:09
Disable Seek lock
add_filter('wplms_course_settings',function($data){
$data['course']['status']['seek_lock']=false;
return $data;
});
@MrVibe
MrVibe / android
Created June 29, 2020 13:28
For android
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
@MrVibe
MrVibe / function.php
Created June 24, 2020 03:50
Remove Expired course status when user did not start the course and Enable course status from course start.
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);