Skip to content

Instantly share code, notes, and snippets.

@99Pratibha
Created Sep 25, 2020
Embed
What would you like to do?
shows the unit duration in hours
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