Skip to content

Instantly share code, notes, and snippets.

View shubham-99fusion's full-sized avatar

shubham-99fusion

View GitHub Profile
add_filter('wplms_course_creation_tabs',function($tabs){
$curriculum_elements = $tabs['course_curriculum']['fields'][0]['curriculum_elements'];
foreach ($curriculum_elements as $key => $curriculum_element) {
if($curriculum_element['type'] == 'assignment'){
foreach ($curriculum_element['types'] as $key1 => $type) {
if($type['id'] == 'textarea'){
$curriculum_element['types'][$key1]['icon'] = 'vicon vicon-text'; //your icon ti will be replace by vicon from https://themify.me/themify-icons
}elseif($type['id'] == 'upload'){
unset($curriculum_element['types'][$key1]);
}
@shubham-99fusion
shubham-99fusion / Add member article widger
Last active May 21, 2021 12:13
Option will show in member profile date option
add_filter('vibebp_member_profile_data',function($options){
$options['user_article_page'] =__('User Article','vibebp');
return $options;
},10,1);
add_action('vibebp_profile_get_profile_data',function($type,$user_id){
if($type == 'user_article_page'){
echo '<span class="button is-primary user_article_page"><a target="_blank" href="'.get_author_posts_url($user_id).'">'.__('Go to Blog Page','vibebp').'</a></span>';
}
},10,2);
add_filter('bp_course_api_get_instructor_tabs',function($tabs,$course_id){
$ntabs = array();
$which_tabs_to_remove = ['mytab1','mytab2'];
foreach ($tabs as $key => $tab) {
if(!in_array($tab['key'],$which_tabs_to_remove)){
$ntabs[] = $tab;
}
}
return $ntabs;
},99,2);
let cssFiles = [
"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.12.0/css/bootstrap-tour-standalone.min.css"
];
let jsFiles = [
"https://code.jquery.com/jquery-3.6.0.min.js"
];
alert('loading start')
let allPromises = [];
jsFiles.map((f) => {
allPromises.push(loadfiles(f, "js"));
@shubham-99fusion
shubham-99fusion / gist:d4c7a9db35b9e2f268720a7daa0cf1ef
Created April 14, 2021 06:15
Phone-Auth default country set
add_filter('wplms-phone_script_args',function($args){
$args['settings']['default_country_code'] = 'US'; //Like US for united state
return $args;
},10,1);
add_action('wp_enqueue_scripts',function(){
?>
<script>
document.addEventListener('unit_loaded',function(){
document.querySelectorAll('.flowplayer').forEach(function(element){
flowplayer(element,JSON.parse(element.getAttribute('data-item')));
})
});
</script>
<?php
@shubham-99fusion
shubham-99fusion / bbb-private-replies.php
Last active January 27, 2021 12:51
bbb-private-replies.php for wplms4.x helpdesk plugin
<?php
/*
Plugin Name: bbPress - Private Replies
Plugin URL: http://pippinsplugins.com/bbpress-private-replies
Description: Allows users to set replies as private so that only the original poster and admins can see it
Version: 1.3.3
Author: Pippin Williamson and Remi Corson
Author URI: http://pippinsplugins.com
Contributors: mordauk, corsonr
Text Domain: bbp_private_replies
@shubham-99fusion
shubham-99fusion / Course users see the private replies of forum's topic
Last active April 6, 2021 07:29
Course user see the private replies(update)
if(!empty($GLOBALS['bbp_private_replies'])){
//settings in course settings page
add_filter('wplms_course_creation_tabs','add_in_front_end');
function add_in_front_end($settings){
$fields = $settings['course_settings']['fields'];
$arr=array(array(
'label' => __('Course Students can see forum private reply','wplms-front-end'), // <label>
'desc' => __('Course Students can see forum private reply','wplms-front-end'),
'text'=>__('Forum private reply','wplms-front-end' ),// description
@shubham-99fusion
shubham-99fusion / course user see reply
Last active January 22, 2021 10:26
course and forums are connected then course author,reply author and topic author can see private replies.
if(!empty($GLOBALS['bbp_private_replies'])){
//settings in course settings page
add_filter('wplms_course_creation_tabs','add_in_front_end');
function add_in_front_end($settings){
$fields = $settings['course_settings']['fields'];
$arr=array(array(
'label' => __('Course Students can see forum private reply','wplms-front-end'), // <label>
'desc' => __('Course Students can see forum private reply','wplms-front-end'),
'text'=>__('Forum private reply','wplms-front-end' ),// description
Calendar part can only be translate using locale language code like 'en' for English , 'zh' for chineese
Refer this doc to get language language code:: https://www.w3schools.com/tags/ref_language_codes.asp
To translate calendar using the custom filter in your customizer or child theme code.Add the billow code.
//code starts
add_filter('vibefullcalendar_locale_languageCode',function($lan_code){
return 'zh'; // your language code from https://www.w3schools.com/tags/ref_language_codes.asp
},10,1);
//code ends