Skip to content

Instantly share code, notes, and snippets.

View ibrahim-kardi's full-sized avatar

Mohammad Ibrahim ibrahim-kardi

  • Mirpur, Dhaka -1216,Bangladesh
View GitHub Profile
## ---- 1. Backend ---- ##
// Adding a custom Meta container to admin products pages
add_action('add_meta_boxes', 'create_custom_meta_box');
if (!function_exists('create_custom_meta_box')) {
function create_custom_meta_box()
{
add_meta_box(
'custom_product_meta_box',
__(' Product Main URL <em>(orginal)</em>', 'cmb'),
.tutor-course-loop-header-meta .tutor-course-wishlist {
z-index: 100;
position: absolute;
right: 6%;
}
@ibrahim-kardi
ibrahim-kardi / course-price-woocommerce.php
Created November 16, 2021 08:07
defult archive price not showing
<?php
//file path -> plugins/tutor/templates/loop/course-price-woocommerce.php
/**
* Course loop price
*
* @since v.1.0.0
* @author themeum
* @url https://themeum.com
*
@ibrahim-kardi
ibrahim-kardi / course-topics.php
Created November 18, 2021 06:41
To disable course first lesson content auto expand,need to override the file or replace the override file content with this, file location wp-content/plugins/tutor/templates/single/course/course-topics.php
<?php
/**
* Template for displaying single course
*
* @since v.1.0.0
*
* @author Themeum
* @url https://themeum.com
*
* @package TutorLMS/Templates
@ibrahim-kardi
ibrahim-kardi / course-topics.php
Created November 23, 2021 06:58
location plugins/tutor-lms-elementor-addons/templates/course/course-topics.php, collapse disable
<div class="tutor-wrap">
<?php
if (!defined('ABSPATH'))
exit;
global $wp_query;
if (is_user_logged_in()) {
tutor-lms-elementor-addons/templates/course/about.php
Update the page with this code
<?php
global $post;
?>
<div class="etlms-course-summery">
<h4 class="tutor-segment-title">
<?php esc_html_e($settings['section_title_text'], 'tutor-lms-elementor-addons'); ?>
@ibrahim-kardi
ibrahim-kardi / enrolled-course-shotcode
Created November 29, 2021 06:32
use this shortcode [own_enrolled_course_list]
// The shortcode function
function tutor_current_user_enrolled_course_list() {
$my_courses = tutor_utils()->get_enrolled_courses_by_user(get_current_user_id(), array('private', 'publish'));
if ($my_courses && $my_courses->have_posts()):
while ($my_courses->have_posts()):
$my_courses->the_post();
$avg_rating = tutor_utils()->get_course_rating()->rating_avg;
$tutor_course_img = get_tutor_course_thumbnail_src();
plugins/tutor/templates/dashboard/my-profile.php, line 17 this
$phone = get_user_meta($uid,'phone_number',true); , need to replace with this fixed code , just prefix _ issue
$phone = get_user_meta($uid,'_phone_number',true); (edited)
ALso,
/wp-content/plugins/tutor/templates/dashboard/settings/profile.php, 126 line, need to change
<?php echo get_user_meta($user->ID,'_phone_number',true); ?>
@ibrahim-kardi
ibrahim-kardi / all-student-shortcode.php
Created December 4, 2021 09:28
[own_student_list] , need to use this to show all enrolled students list
function tutorenrolled_student_list() {
global $wp_query, $wp;
$user = wp_get_current_user();
$paged = 1;
$url = home_url( $wp->request );
$url_path = parse_url($url, PHP_URL_PATH);
$basename = pathinfo($url_path, PATHINFO_BASENAME);
if ( isset($_GET['paged']) && is_numeric($_GET['paged']) ) {
@ibrahim-kardi
ibrahim-kardi / utils.php
Created December 6, 2021 12:00
/wp-content/plugins/tutor/classes/Utils.php
$url = site_url();
echo paginate_links( array(
//'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'base' => str_replace( $big, '%#%', $url .'/home/page/'.$big ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $total_num_pages
) );