Created
August 28, 2017 18:01
-
-
Save thomasplevy/52989e1460cd4a4d4228302f3947a228 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 | |
add_action( 'init', 'my_manual_achievement' ); | |
function my_manual_achievement() { | |
$user_id = 123; // WP User ID of the user you want to award an achievement to | |
$achievement_id = 456; // WP Post ID of the LifterLMS Achievement Post you want to award to the user | |
$post_id = 5202; // The Releated WP Post ID that triggered the awarding of this achievement. This could be a Course, Lesson, Section, or Quiz ID | |
$achievements = LLMS()->achievements(); | |
$achievements->trigger_engagement( $user_id, $achievement_id, $post_id ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment