• Hey! I was wondering if it’s possible to add a hook to whenever a course page is visited that has been completed and passed – i would like a text that says congratulations and have a download link if the course is passed whenever the user visits it again

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ken Nguyen

    (@kendy73)

    Hi ninjac4,

    Sure :). I’m checking.

    Please wait.

    Regards,

    Ken

    Plugin Contributor Ken Nguyen

    (@kendy73)

    /*
     * Add message for users who passed the course.
     */
    function add_message_for_passed_users() {
    	$user = learn_press_get_course_user();
    	$course = get_the_ID();
    	$grade = $user->get_course_grade( $course );
    	if ($grade == 'passed') {
    		echo 'I have a message for you.';
    	}
    }
    
    add_action( 'learn_press_content_learning_summary', 'add_message_for_passed_users', 27 );

    Please try ??

    Thread Starter ninjac4

    (@ninjac4)

    Hi thanks for the reply, altough it doesn’t seem to be working:

    $grade = $user->get_course_grade( $course );

    returns an empty object – i have the latest version installed and the addon prerequisite courses + certificate

    Plugin Contributor Ken Nguyen

    (@kendy73)

    Hi ninjac4,

    Please let me know about the LearnPress version you are using.

    Regards,

    Ken

    Thread Starter ninjac4

    (@ninjac4)

    Hey!

    I’m using Version 2.1.9.5

    With:
    LearnPress – Certificate
    LearnPress – Gradebook
    LearnPress – Prerequisites Courses

    Plugin Contributor Ken Nguyen

    (@kendy73)

    Hi ninjac4,

    In this case I will need to check your case more carefully. Please send me a request to [email protected] with subject “ninjac4 – Eduma Support”.

    Regards,

    Ken

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘After course download link’ is closed to new replies.