Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created October 5, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasplevy/9afac8dfa704328e369f8ca29bd0b74d to your computer and use it in GitHub Desktop.
Save thomasplevy/9afac8dfa704328e369f8ca29bd0b74d to your computer and use it in GitHub Desktop.
<?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