Warning: This method has been deprecated. LLMS_Achievement_User::trigger() is deprecated with no replacement instead.

Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Achievement_User::trigger( int $user_id, int $id, int $lesson_id )

Creates new instance of WP_User and calls parent method create


Parameters Parameters

$user_id

(int) (Required) ID of user.

$id

(int) (Required) ID of post.

$lesson_id

(int) (Required) ID of associated lesson.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/achievements/class.llms.achievement.user.php

207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
private function trigger( $user_id, $id, $lesson_id ) {
 
    $this->init( $id, $user_id, $lesson_id );
 
    // Only award achievement if the user hasn't already earned it.
    if ( $this->has_user_earned() ) {
        return;
    }
 
    if ( $user_id ) {
 
        $this->object     = new WP_User( $user_id );
        $this->user_login = stripslashes( $this->object->user_login );
        $this->user_email = stripslashes( $this->object->user_email );
        $this->recipient  = $this->user_email;
 
    }
 
    if ( ! $this->is_enabled() ) {
        return;
    }
 
    $this->create( $this->get_content() );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.