LLMS_Certificate_User::init( int $email_id, int $person_id, int $lesson_id )

Sets up data needed to generate certificate.


Description Description


Parameters Parameters

$email_id

(int) (Required) ID of Certificate

$person_id

(int) (Required) ID of the user receiving the certificate

$lesson_id

(int) (Required) ID of associated lesson


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/certificates/class.llms.certificate.user.php

	public function init( $email_id, $person_id, $lesson_id ) {
		global $wpdb;

		$email_content = get_post( $email_id );
		$email_meta = get_post_meta( $email_content->ID );

		$this->certificate_template_id	= $email_id;
		$this->lesson_id    			= $lesson_id;
		$this->title 					= $email_content->post_title;
		$this->certificate_title 		= $email_meta['_llms_certificate_title'][0];
		$this->content 					= $email_content->post_content;
		$this->image 					= $email_meta['_llms_certificate_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 	= 'certificates/template.php';
		$this->email_content	= $email_content->post_content;
		$this->account_link 	= get_permalink( llms_get_page_id( 'myaccount' ) );

		$this->user_login = $this->user_data->user_login;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
?? Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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