Skip to content

Instantly share code, notes, and snippets.

View creativeartbd's full-sized avatar

Shibbir Ahmed creativeartbd

View GitHub Profile
@creativeartbd
creativeartbd / course-archive.php
Last active July 13, 2023 16:13
Enable filter option on Docent Pro Theme - Currently, On the Docent Pro theme, the filter is not showing after enable the filter option from the tutor settings. Because there is no code available for the filter. So you may replace this file from this location: wp-contents/themes/docent-pro/tutor folder.
<?php
get_header();
get_template_part('lib/sub-header'); ?>
<div class="<?php tutor_container_classes() ?>">
<div class="tutor-archive">
<?php
$course_filter = (bool) tutor_utils()->get_option('course_archive_filter', false);
$supported_filters = tutor_utils()->get_option('supported_course_filters', array());
if ($course_filter && count($supported_filters)) {
@creativeartbd
creativeartbd / functions.php
Last active October 17, 2024 11:38
Tutor LMS - Redirect user to lesson page directly
/*
On the Enrolled Course page, You can see all the enrolled courses, right? Now, if you click on the title of the course you will be redirected to the course page.
Okay, but if you want to redirect the user to the first lesson of any course then what? Well, use this code:
Go to wp-content/plugins/tutor/templates/dashboard/enrolled-courses.php at line number 39. Here you can see this code:
*/
$custom_url = home_url($post->post_type.'/'.$post->post_name);
@creativeartbd
creativeartbd / single-course.php
Last active July 13, 2023 16:12
Tutor LMS - Hide the content as well as the topic list for password protected course. So, go to wp-content/plugins/tutor/templates/single-course.php file and then replace all the code by this gist code.
<?php
/**
* Template for displaying single course
*
* @since v.1.0.0
*
* @author Themeum
* @url https://themeum.com
*
* @package TutorLMS/Templates
@creativeartbd
creativeartbd / functions.php
Created July 13, 2021 11:12
Tutor LMS - Send welcome email to register user.
function send_email_after_signup( $user_id ) {
$student_id = tutils()->get_user_id($user_id);
$student = get_userdata($student_id);
$site_url = get_bloginfo( 'url' );
$site_name = get_bloginfo( 'name' );
$display_name = $student->display_name;
$user_email = $student->user_email;
@creativeartbd
creativeartbd / functions.php
Last active October 12, 2021 08:55
WP Crowdfunding - Change stripe payment description text
<?php
add_filter( 'wc_stripe_generate_payment_request', 'change_stripe_payment_description', 10, 2 );
function change_stripe_payment_description( $post_data, $order ) {
// Get the order number
$order = wc_get_order( $order->get_order_number() );
// Get the order iterms
$items = $order->get_items();
// Check if it's crowdfunding produ ct
$is_crowdfunding = get_post_meta( $order->get_order_number(), 'is_crowdfunding_order', true );