-
-
Save Anshu-wwc/fe29723705a3b451397d32c053bf48aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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