Skip to content

Instantly share code, notes, and snippets.

View upload box remove
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
Option will show in member profile date option
View Add member article widger
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);
View Edit course tab remove
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);
View Load File Async
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"));
View gist:d4c7a9db35b9e2f268720a7daa0cf1ef
add_filter('wplms-phone_script_args',function($args){
$args['settings']['default_country_code'] = 'US'; //Like US for united state
return $args;
},10,1);
View FV-Player support for WPLMS 4.0 in Unit Page
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 Jan 27, 2021
bbb-private-replies.php for wplms4.x helpdesk plugin
View bbb-private-replies.php
<?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
View Course users see the private replies of forum's topic
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 Jan 22, 2021
course and forums are connected then course author,reply author and topic author can see private replies.
View course user see reply
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
View vibecalendar-translation
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