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

Creates new instance of WP_User and calls parent method create


Description Description


Parameters Parameters

$person_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

	public 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 ↑

User Contributed Notes User Contributed Notes

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





Permalink: