Warning: This method has been deprecated. LLMS_Achievement_User::init() 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::init( int $id, int $person_id, int $lesson_id )

Initializes all of the variables needed to create the achievement post.


Parameters Parameters

$id

(int) (Required) Id of post.

$person_id

(int) (Required) Id of user.

$lesson_id

(int) (Required) Id of associated lesson.


Top ↑

Return Return

(void)


Top ↑

Source Source

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

	private function init( $id, $person_id, $lesson_id ) {
		global $wpdb;

		$content = get_post( $id );
		$meta    = get_post_meta( $content->ID );

		$this->achievement_template_id = $id;
		$this->lesson_id               = $lesson_id;
		$this->title                   = $content->post_title;
		$this->achievement_title       = $meta['_llms_achievement_title'][0];
		$this->content                 = ( ! empty( $content->post_content ) ) ? $content->post_content : $meta['_llms_achievement_content'][0];
		$this->image                   = $meta['_llms_achievement_image'][0];
		$this->userid                  = $person_id;
		$this->user                    = get_user_meta( $person_id );
		$this->user_data               = get_userdata( $person_id );
		$this->user_firstname          = ( '' != $this->user['first_name'][0] ? $this->user['first_name'][0] : $this->user['nickname'][0] );
		$this->user_lastname           = ( '' != $this->user['last_name'][0] ? $this->user['last_name'][0] : '' );
		$this->user_email              = $this->user_data->data->user_email;
		$this->template_html           = 'achievements/template.php';
		$this->account_link            = get_permalink( llms_get_page_id( 'myaccount' ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 LLMS_Achievement_User::init() is deprecated with no replacement.
3.24.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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