Created
October 5, 2016 20:40
-
-
Save thomasplevy/9afac8dfa704328e369f8ca29bd0b74d 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 | |
$certs = LLMS()->certificates(); // our certs class | |
$cert_id = 123; // this should be the WP Post ID of the certificate you created on the admin panel via LLMS | |
$related_post_id = 456; // this is really for record keeping only at the moment | |
// should be the WP post id of the course, lesson, or section which | |
// the student has completed to earn the certificate | |
$students = new WP_User_Query(); // get your students however you see fit | |
if ( ! empty( $students->results ) ) { | |
foreach ( $students->results as $student ) { | |
$certs->trigger_engagement( $student->ID, $certificate_id, $related_post_id ); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment