| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying content of single course offline. |
| 4 |
* |
| 5 |
* @author ThimPress |
| 6 |
* @package LearnPress/Templates |
| 7 |
* @version 4.2.7.6 |
| 8 |
* @version 1.0.1 |
| 9 |
*/ |
| 10 |
|
| 11 |
use LearnPress\Models\CourseModel; |
| 12 |
|
| 13 |
defined( 'ABSPATH' ) || exit; |
| 14 |
|
| 15 |
/** |
| 16 |
* Header for page |
| 17 |
*/ |
| 18 |
if ( ! wp_is_block_theme() ) { |
| 19 |
get_header( 'course' ); |
| 20 |
} |
| 21 |
|
| 22 |
$course_id = get_the_ID(); |
| 23 |
if ( $course_id ) { |
| 24 |
/** |
| 25 |
* If course has set password |
| 26 |
*/ |
| 27 |
if ( post_password_required() ) { |
| 28 |
echo '<div class="lp-content-area">'; |
| 29 |
echo get_the_password_form(); |
| 30 |
echo '</div>'; |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
$courseModel = CourseModel::find( $course_id, true ); |
| 35 |
if ( ! $courseModel ) { |
| 36 |
return; |
| 37 |
} |
| 38 |
|
| 39 |
do_action( 'learn-press/single-course/layout', $courseModel ); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Footer for page |
| 44 |
*/ |
| 45 |
if ( ! wp_is_block_theme() ) { |
| 46 |
get_footer( 'course' ); |
| 47 |
} |
| 48 |
|