Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. add_filter( 'coursepress_unit_time_estimation_minutes_and_seconds_format', 'cp_convert_minutes_to_hours', 10, 2 );
  3. function cp_convert_minutes_to_hours( $time ) {
  4.  
  5. $get_minutes = explode(":", $time);
  6.  
  7. if($get_minutes[0] < 90) return $time;
  8.  
  9. $hours = round( ( $get_minutes[0] / 60 ) , 2) ;
  10.  
  11. return $hours. ' hours';
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement