Home › Forums › Legacy Support › 4.0 Bugs & Issues › Course start date on certificate shows short code
- This topic has 10 replies, 2 voices, and was last updated 3 years, 9 months ago by Veronica.
Viewing 11 posts - 1 through 11 (of 11 total)
-
AuthorPosts
-
April 16, 2021 at 3:50 am #352756RMASpectatorI 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]'; });April 16, 2021 at 12:43 pm #352891VeronicaModeratorhi can you please confirm the versions of the pdf certificate, vibebp, and wplms pluginApril 16, 2021 at 3:11 pm #352935RMASpectatorWPLMS 4.0April 17, 2021 at 5:24 am #352998VeronicaModeratorchecking on your siteApril 17, 2021 at 5:29 am #353000VeronicaModeratorhi 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 limitationsApril 17, 2021 at 7:24 pm #353132RMASpectatorWell I have update or added the PDF certificate. that did not fix the date start short code issueApril 19, 2021 at 8:18 am #353286VeronicaModeratorhi the delay in response due to support holiday i am replicating this on local if i found the issue then i will let you knowApril 19, 2021 at 9:02 am #353294VeronicaModeratorhi just checked on local and it is working fine: http://somup.com/crfqjYF6Cm please make sure you have copied the code properlyApril 19, 2021 at 9:28 am #353299VeronicaModeratorhi please add this code
and use this shortcode: [certificate_course_start_date] let me know if this helpsadd_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]'; });
April 21, 2021 at 3:45 am #353656RMASpectatorThank. 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.0April 21, 2021 at 6:50 am #353695VeronicaModeratorhi you need to install the same plugin for v4 and add the code in the same file -
AuthorPosts
Viewing 11 posts - 1 through 11 (of 11 total)
- The topic ‘Course start date on certificate shows short code’ is closed to new replies.