Course start date on certificate shows short code

Home Forums Legacy Support 4.0 Bugs & Issues Course start date on certificate shows short code

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #352756
    RMA
    Spectator
    I have upgraded to 4.0 and now the student course start date on the certificate shows the shortcode. screenshot. https://snipboard.io/Ya701z.jpg for 3.0. I was given this code to insert. I don't know if this is still valid for 4.0. or is there another shortcode for 4.0? add_shortcode('certificate_course_start_date',function($atts, $content = null){ $uid=$_GET['u']; $cid=$_GET['c']; global $bp,$wpdb; if(isset($uid) && is_numeric($uid) && isset($cid) && is_numeric($cid) && get_post_type($cid) == 'course'){ $course_submission_date = $wpdb->get_var($wpdb->prepare( " SELECT activity.date_recorded FROM {$bp->activity->table_name} AS activity WHERE activity.component = 'course' AND activity.type = 'start_course' AND user_id = %d AND item_id = %d ORDER BY date_recorded DESC LIMIT 0,1 " ,$uid,$cid)); return date_i18n(get_option( 'date_format' ), strtotime($course_submission_date)); } return '[certificate_course_start_date]'; });
    #352891
    Veronica
    Moderator
    hi can you please confirm the versions of the pdf certificate, vibebp, and wplms plugin
    #352935
    RMA
    Spectator
    WPLMS 4.0
    #352998
    Veronica
    Moderator
    checking on your site
    #353000
    Veronica
    Moderator
    hi just checked on your site and found that you are not using PDF Certificate plugin! if use PDF certificate plugin and then check with the same as the default editor is very old has some limitations
    #353132
    RMA
    Spectator
    Well I have update or added the PDF certificate. that did not fix the date start short code issue
    #353286
    Veronica
    Moderator
    hi the delay in response due to support holiday i am replicating this on local if i found the issue then i will let you know
    #353294
    Veronica
    Moderator
    hi just checked on local and it is working fine: http://somup.com/crfqjYF6Cm please make sure you have copied the code properly
    #353299
    Veronica
    Moderator
    hi please add this code
    add_shortcode('certificate_course_start_date',function($atts, $content = null){
    
    $uid=$_GET['u'];
    
    $cid=$_GET['c'];
    
    global $bp,$wpdb;
    
    if(isset($uid) && is_numeric($uid) && isset($cid) && is_numeric($cid) && get_post_type($cid) == 'course'){
    
    $course_submission_date = $wpdb->get_var($wpdb->prepare( "
    
    SELECT activity.date_recorded FROM {$bp->activity->table_name} AS activity
    
    WHERE activity.component = 'course'
    
    AND activity.type = 'start_course'
    
    AND user_id = %d
    
    AND item_id = %d
    
    ORDER BY date_recorded DESC LIMIT 0,1
    
    " ,$uid,$cid));
    
    return date_i18n(get_option( 'date_format' ), strtotime($course_submission_date));
    
    }
    
    return '[certificate_course_start_date]';
    
    });
    and use this shortcode: [certificate_course_start_date] let me know if this helps
    #353656
    RMA
    Spectator
    Thank. I am sure where to place the code in 4.O. In 3.0 we would put it in plugin customizer. I don't see that in 4.0
    #353695
    Veronica
    Moderator
    hi you need to install the same plugin for v4 and add the code in the same file
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Course start date on certificate shows short code’ is closed to new replies.