LLMS_Template_Loader::restricted_by_course_prerequisite( array $info )
Handle redirects and messages when a user attempts to access an item restricted by a course prerequisite.
Description Description
Redirect to parent course and display message. If course do nothing.
Parameters Parameters
- $info
-
(array) (Required) Array of restriction info from
llms_page_restricted()
.
Return Return
(void)
Source Source
File: includes/class.llms.template.loader.php
* @return void */ public function restricted_by_course_prerequisite( $info ) { if ( 'course' === get_post_type( $info['content_id'] ) ) { return; } $msg = llms_get_restriction_message( $info ); $course = llms_get_post_parent_course( $info['content_id'] ); $redirect = get_permalink( $course->get( 'id' ) ); $this->handle_restriction( apply_filters( 'llms_restricted_by_course_prerequisite_message', $msg, $info ), apply_filters( 'llms_restricted_by_course_prerequisite_redirect', $redirect, $info ), 'error' );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.7.3 | Introduced. |