Support » Plugin: Tutor LMS - eLearning and online course solution » Bugs in Course Prerequisites

  • Resolved vandung93

    (@vandung93)


    Hello @team,

    There are some problems with Course Prerequisites add-on, please check & fix it.

    Problem 1: Missing wp_reset_postdata() after setup_postdata( $post );
    This made lost global $post lesson:
    This is your code:

    if ($requiredComplete) {
    			global $post;
    
    			$post = get_post($course_id);
    			setup_postdata($post);
    
    			ob_start();
    			tutor_load_template('single.course.course-prerequisites', compact('savedPrerequisitesIDS'), true);
    			return ob_get_clean();
    		}

    This should be fixed with this code:

    if ($requiredComplete) {
    				global $post;
    
    				$post = get_post($course_id);
    				setup_postdata($post);
    
    				ob_start();
    				tutor_load_template('single.course.course-prerequisites', compact('savedPrerequisitesIDS'), true);
    
    				$content =  ob_get_clean();
    				wp_reset_postdata();
    
    				return $content;
    			}

    Problem 2: Course Prerequisite is just working with Post Type ‘Lesson’ but Quiz, Zoom meeting, assignment is not working.
    Students is still viewing these lesson content.
    http://prntscr.com/1064f40
    http://prntscr.com/1064fp2

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.