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
@ibrahim-kardi
ibrahim-kardi / login-shortcode
Created March 3, 2022 15:40
use this [login_lms]
add_shortcode( 'login_lms', 'lms_shortcode' );
function lmscodes_init(){
function lms_shortcode() {
if(tutils()->get_option('disable_tutor_native_login')) {
// Refer to login oage
header('Location: '.wp_login_url($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
exit;
}
It will enable the auto-check for creating an account.
add_filter('woocommerce_create_account_default_checked' , function ($checked){
return true;
});
@ibrahim-kardi
ibrahim-kardi / wpml css loading issue
Created December 17, 2021 09:05
classes-> assets.php
if(tutor_utils()->is_tutor_frontend_dashboard()) {
wp_enqueue_style('tutor-frontend-dashboard-css', tutor()->url . 'assets/css/tutor-frontend-dashboard.min.css', tutor()->version);
}
@ibrahim-kardi
ibrahim-kardi / crowd-funding-option-panel-redirection-url
Created December 9, 2021 16:19
crowd funding option panel url redirection URL not saving issue
/plugins/wp-crowdfunding/settings/tabs/Tab_General.php
01. Need to add this code and replace with 112 to 118 line
array(
'id' => 'wpcf_redurl',
'type' => 'text',
'value' => ! empty( get_option( 'wpcf_redurl' ) ) ? absint( get_option( 'wpcf_redurl' ) ) : esc_url( home_url( '/' ) ),
'label' => __('Redirect URL for User Registration Success','wp-crowdfunding'),
),
@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
) );
@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']) ) {
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 / 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();
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 / 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()) {