Created
November 30, 2016 21:07
-
-
Save thomasplevy/a5c88c919ffae56ae910a867bd7ed439 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't add this to your functions.php file | |
/** | |
* Do something cool upon user enrollment in a course | |
* @param int $student_id WP User ID | |
* @param int $course_id WP Post ID of the Course | |
* @return void | |
*/ | |
function my_enrollment_acton( $student_id, $course_id ) { | |
// add the last course a user enrolled in to the usermeta table | |
update_user_meta( $student_id, 'last_enrollment_id', $course_id ); | |
} | |
add_action( 'llms_user_enrolled_in_course', 'my_enrollment_acton', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment