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

Was this article helpful?

Related Articles

2 Comments

  1. hfarmakis77

    I added this code and now I cannot access my WP at all. It generates this code:

    Parse error: syntax error, unexpected ‘6’ (T_LNUMBER) in /home/profe116/public_html/wp-content/plugins/wplms-customizer/wplms-customizer.php on line 40

    HELP

    1. Login via FTP and remove this code, it seems an unwanted character was copied resulting in this. If you face any issues in doing so, please create a topic or send me an email (at [email protected] with subject “WPLMS Support”) share FTP credentials of your site asap.

Leave A Comment?