LLMS_User_Postmeta::get_link( string $context = 'course' )
Retrieve a link for the item on the admin panel
Description Description
Parameters Parameters
- $context
-
(string) (Optional) display context [course|student]
Default value: 'course'
Return Return
(string)
Source Source
File: includes/models/model.llms.user.postmeta.php
public function get_link( $context = 'course' ) { switch ( $this->get( 'meta_key' ) ) { case '_achievement_earned': $achievement = new LLMS_User_Achievement( $this->get( 'meta_value' ) ); $url = get_edit_post_link( $achievement->get( 'achievement_template' ) ); break; case '_certificate_earned': $certificate = new LLMS_User_Certificate( $this->get( 'meta_value' ) ); $url = get_edit_post_link( $certificate->get( 'certificate_template' ) ); break; case '_email_sent': $url = get_edit_post_link( $this->get( 'meta_value' ) ); break; case '_enrollment_trigger': $url = get_edit_post_link( str_replace( 'order_', '', $this->get( 'meta_value' ) ) ); break; default: $student = $this->get_student(); if ( ! $student ) { return ''; } $course = false; if ( 'course' === get_post_type( $this->get( 'post_id' ) ) ) { $course = llms_get_post( $this->get( 'post_id' ) ); } else { $course = llms_get_post_parent_course( $this->get( 'post_id' ) ); } if ( $course ) { $url = LLMS_Admin_Reporting::get_current_tab_url( array( 'course_id' => $course->get( 'id' ), 'stab' => 'courses', 'student_id' => $student->get_id(), 'tab' => 'students', ) ); } }// End switch(). }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.15.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: