Show unit time in minutes only in curriculum

Please add the  given code in your wplms-customizer.php file in wplms customizer plugin :

add_filter('bp_course_get_full_course_curriculum','wplms_set_unit_curriculum_time_to_minites_Seconds');
function wplms_set_unit_curriculum_time_to_minites_Seconds($arr){
	foreach($arr as $key => $curriculum){
		if($curriculum['type'] == 'unit'){
		$duration = get_post_meta($curriculum['id'],'vibe_duration',true);
		$duration_parameter = apply_filters("vibe_".$curriculum['type']."_duration_parameter",60,$curriculum['id']);
		$arr[$key]['duration'] = '<span class="time"><i class="fa fa-clock-o"></i> '.(($duration >9998)?_x('Unlimited','Unlimited unit duration label','vibe'):gmdate("i:s", $duration*$duration_parameter)).'</span>';

		}
	}

	return $arr;
}

 

Was this article helpful?

Leave A Comment?