← All changes
|
templates/loop/single-course/loop-section-item.php
+46
-46
4.3.9.1
→
4.4.8
View file →
| @@ -1,46 +1,46 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying curriculum tab of single course. | |
| 4 | - * | |
| 5 | - * @author ThimPress | |
| 6 | - * @package Learnpress/Templates | |
| 7 | - * @version 4.1.5 | |
| 8 | - */ | |
| 9 | - | |
| 10 | -defined( 'ABSPATH' ) || exit(); | |
| 11 | - | |
| 12 | -// PARAM: section_item, course_item, can_view_item, user, course_id is required. | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * @var LP_Model_User_Can_View_Course_Item $can_view_item | |
| 16 | - * @var LP_Course_Item $course_item | |
| 17 | - */ | |
| 18 | -if ( empty( $section_item ) || empty( $course_item ) || empty( $can_view_item ) || empty( $course_id ) ) { | |
| 19 | - return; | |
| 20 | -} | |
| 21 | - | |
| 22 | -?> | |
| 23 | - | |
| 24 | -<li class="course-item <?php echo esc_attr( implode( ' ', $course_item->get_class_v2( $course_id, $section_item['ID'], $can_view_item ) ) ); ?> " | |
| 25 | - data-id="<?php echo esc_attr( $section_item['ID'] ); ?>"> | |
| 26 | - <a class="section-item-link" href="<?php echo esc_url_raw( $course_item->get_permalink() ); ?>"> | |
| 27 | - | |
| 28 | - <div class="course-item-info"> | |
| 29 | - <span class="item-name"><?php echo esc_html( $section_item['post_title'] ); ?></span> | |
| 30 | - <div | |
| 31 | - class="course-item-info-pre"><?php do_action( 'learn-press/course-section-item/before-' . $course_item->get_item_type() . '-meta', $course_item ); ?></div> | |
| 32 | - </div> | |
| 33 | - | |
| 34 | - <div class="course-item-meta"> | |
| 35 | - <?php if ( $course_item->is_preview() && isset( $user ) && ! $user->has_enrolled_or_finished( $course_id ) ) : ?> | |
| 36 | - <span class="item-meta course-item-preview" | |
| 37 | - data-preview="<?php esc_attr_e( 'Preview', 'learnpress' ); ?>"></span> | |
| 38 | - <?php else: ?> | |
| 39 | - <span class="item-meta course-item-status" | |
| 40 | - title="<?php echo esc_attr( $course_item->get_status_title() ); ?>"></span> | |
| 41 | - <?php endif; ?> | |
| 42 | - | |
| 43 | - <?php do_action( 'learn-press/course-section-item/after-' . $course_item->get_item_type() . '-meta', $course_item ); ?> | |
| 44 | - </div> | |
| 45 | - </a> | |
| 46 | -</li> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying curriculum tab of single course. | |
| 4 | + * | |
| 5 | + * @author ThimPress | |
| 6 | + * @package Learnpress/Templates | |
| 7 | + * @version 4.1.5 | |
| 8 | + */ | |
| 9 | + | |
| 10 | +defined( 'ABSPATH' ) || exit(); | |
| 11 | + | |
| 12 | +// PARAM: section_item, course_item, can_view_item, user, course_id is required. | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * @var LP_Model_User_Can_View_Course_Item $can_view_item | |
| 16 | + * @var LP_Course_Item $course_item | |
| 17 | + */ | |
| 18 | +if ( empty( $section_item ) || empty( $course_item ) || empty( $can_view_item ) || empty( $course_id ) ) { | |
| 19 | + return; | |
| 20 | +} | |
| 21 | + | |
| 22 | +?> | |
| 23 | + | |
| 24 | +<li class="course-item <?php echo esc_attr( implode( ' ', $course_item->get_class_v2( $course_id, $section_item['ID'], $can_view_item ) ) ); ?> " | |
| 25 | + data-id="<?php echo esc_attr( $section_item['ID'] ); ?>"> | |
| 26 | + <a class="section-item-link" href="<?php echo esc_url_raw( $course_item->get_permalink() ); ?>"> | |
| 27 | + | |
| 28 | + <div class="course-item-info"> | |
| 29 | + <span class="item-name"><?php echo esc_html( $section_item['post_title'] ); ?></span> | |
| 30 | + <div | |
| 31 | + class="course-item-info-pre"><?php do_action( 'learn-press/course-section-item/before-' . $course_item->get_item_type() . '-meta', $course_item ); ?></div> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <div class="course-item-meta"> | |
| 35 | + <?php if ( $course_item->is_preview() && isset( $user ) && ! $user->has_enrolled_or_finished( $course_id ) ) : ?> | |
| 36 | + <span class="item-meta course-item-preview" | |
| 37 | + data-preview="<?php esc_attr_e( 'Preview', 'learnpress' ); ?>"></span> | |
| 38 | + <?php else: ?> | |
| 39 | + <span class="item-meta course-item-status" | |
| 40 | + title="<?php echo esc_attr( $course_item->get_status_title() ); ?>"></span> | |
| 41 | + <?php endif; ?> | |
| 42 | + | |
| 43 | + <?php do_action( 'learn-press/course-section-item/after-' . $course_item->get_item_type() . '-meta', $course_item ); ?> | |
| 44 | + </div> | |
| 45 | + </a> | |
| 46 | +</li> | |