Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bob

    (@prasunsen)

    Not yet, we’ll have to add shortcode for this.

    @prasunsen thanks for such awesome plugin

    @gmwestrup: if you are still looking for a workaround I have made the following changes to shortcodes.php in controllers folder:

    function mynamastecertificates() {
       	global $wpdb, $user_ID;
    
       	if(!is_user_logged_in()) return "";
       		$_cert = new NamasteLMSCertificateModel();
    		$certificates = $_cert -> student_certificates($user_ID);
    		$student_id = $user_ID;
       		ob_start();
       		require(NAMASTE_PATH."/views/my-certificates.php");
       		if(!sizeof($certificates)) _e('No Completed certificates.', 'namaste');
       		$content = ob_get_contents();
       		ob_end_clean();
       		return $content;
       }
       add_shortcode( 'mynamastecertificates', 'mynamastecertificates' );

    and I just use [mynamastecertificates] shortcode anywhere on the page or post and it shows the user certificates. ??

    You will have to make some changes to my-certificates.php in view folder as well.

    In line 12 I have changed

    <tr><td><a href="admin.php?page=namaste_view_certificate&id=<?php echo $certificate->id?>&student_id=<?php echo $student_id?>&noheader=1" target="_blank"><?php echo $certificate->title?></a></td>

    to

    <tr><td><a href="<?php echo get_option('siteurl'); ?>/wp-admin/admin.php?page=namaste_view_certificate&id=<?php echo $certificate->id?>&student_id=<?php echo $student_id?>&noheader=1" target="_blank"><?php echo $certificate->title?></a></td>

    Hope it helps ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Certificates’ is closed to new replies.