Created
July 26, 2019 08:15
-
-
Save shubham-99fusion/9da23f2b4fd30b64dd27586e999fc9fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wplms_dashboard_course_progress_student_list', function ($user_id ,$course_id , $percentage){ | |
if(function_exists('bp_is_my_profile') && bp_is_my_profile()){ | |
if(class_exists('WPLMS_Unit_Timings_Init') && function_exists('tofriendlytime')){ | |
$user_id = get_current_user_id(); | |
$obj = WPLMS_Unit_Timings_Init::Instance_WPLMS_Unit_Timings_Init(); | |
$time_spent = $obj->get_course_time_spent( $user_id,$course_id ); | |
if(!empty($time_spent)){ | |
$time_spent = tofriendlytime($time_spent); | |
echo '<div class="wplms_course_time_spent_in_course"><span>'.__('Time Spent:','wplms-ut').'</span><a href="#" class="wplms_course_time_spent" data-user="'.$user_id.'" data-course="'.$course_id.'" data-security="'.wp_create_nonce($course_id.'_wplms_unit_timings_security_'.$user_id).'"> '.$time_spent.'</a></div>'; | |
} | |
} | |
} | |
},99999999,3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment