LLMS_Achievement_User::init( int $id, int $person_id, int $lesson_id )
Initializes all of the variables needed to create the achievement post.
Description Description
Parameters Parameters
- $id
-
(int) (Required) id of post
- $person_id
-
(int) (Required) id of user
- $lesson_id
-
(int) (Required) id of associated lesson
Return Return
(void)
Source Source
File: includes/achievements/class.llms.achievement.user.php
public 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' ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: