Warning: This method has been deprecated. LLMS_Certificate_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_Certificate_User::init( int $email_id, int $person_id, int $lesson_id )
Sets up data needed to generate certificate.
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.
Return Return
(void)
Source Source
File: includes/certificates/class.llms.certificate.user.php
private 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] ?? $email_content->post_title; $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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | LLMS_Certificate_User::init() is deprecated with no replacement. |
3.24.0 | Introduced. |