Unit duration on course certificate

ADD this code in wplms-customizer plugin->wplms-customizer.php

if (!function_exists('vibe_unit_duration_certificate')) {
    function vibe_unit_duration_certificate( $atts, $content = null ) {
    $course_id=$_GET['c'];
    $course_curriculum = bp_course_get_curriculum_units($course_id);
     foreach($course_curriculum as $unit_id){
        $unit_duartion+=get_post_meta($unit_id,'vibe_duration',true);
      }
        return '<div id="unit_duration">'.$unit_duartion.'&nbsp'.__('Minutes').'</div>';
    }
    add_shortcode('certificate_unit_duration', 'vibe_unit_duration_certificate');
}

 

Add this code and then use the shortcode [certificate_unit_duration] in Lms->certificate template

You can convert convert $unit_duration from minutes to hours

Leave a Reply

Your email address will not be published. Required fields are marked *