-
-
Save 99Pratibha/070a5585d03c86f1c9e14dbe2c6abd00 to your computer and use it in GitHub Desktop.
shows the unit duration in 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
add_filter('bp_course_get_full_course_curriculum',function($curriculum){ | |
if(!empty($curriculum)){ | |
foreach($curriculum as $i=>$item){ | |
if($item['type'] == 'unit'){ | |
$duration = get_post_meta($item['id'],'vibe_duration',true); | |
if(is_numeric($duration)){ | |
$duration_parameter = get_post_meta($item['id'],'vibe_unit_duration_parameter',true); | |
$item['duration'] = floor($duration*$duration_parameter/3600).' hours'; | |
$curriculum[$i]=$item; | |
} | |
} | |
} | |
} | |
return $curriculum; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment