Created
November 27, 2015 18:48
-
-
Save sjaved87/81ac201f38bf94ef4b5e to your computer and use it in GitHub Desktop.
CoursePress Pro - Convert time from minutes into hours.
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
<?php | |
add_filter( 'coursepress_unit_time_estimation_minutes_and_seconds_format', 'cp_convert_minutes_to_hours', 10, 2 ); | |
function cp_convert_minutes_to_hours( $time ) { | |
$get_minutes = explode(":", $time); | |
if($get_minutes[0] < 90) return $time; | |
$hours = round( ( $get_minutes[0] / 60 ) , 2) ; | |
return $hours. ' hours'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment