← All changes
|
templates/loop/single-course/loop-section-item.php
+14
-8
4.1.6.9
→
4.4.8
View file →
| @@ -17,23 +17,29 @@ | ||
| 17 | 17 | */ |
| 18 | 18 | if ( empty( $section_item ) || empty( $course_item ) || empty( $can_view_item ) || empty( $course_id ) ) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | + | |
| 21 | 22 | ?> |
| 22 | 23 | |
| 23 | -<li class="course-item <?php echo esc_attr( implode( ' ', $course_item->get_class_v2( $course_id, $section_item['ID'], $can_view_item ) ) ); ?>" | |
| 24 | +<li class="course-item <?php echo esc_attr( implode( ' ', $course_item->get_class_v2( $course_id, $section_item['ID'], $can_view_item ) ) ); ?> " | |
| 24 | 25 | data-id="<?php echo esc_attr( $section_item['ID'] ); ?>"> |
| 25 | 26 | <a class="section-item-link" href="<?php echo esc_url_raw( $course_item->get_permalink() ); ?>"> |
| 26 | - <span class="item-name"><?php echo esc_html( $section_item['post_title'] ); ?></span> | |
| 27 | 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 | + | |
| 28 | 34 | <div class="course-item-meta"> |
| 29 | - <?php do_action( 'learn-press/course-section-item/before-' . $course_item->get_item_type() . '-meta', $course_item ); ?> | |
| 30 | - | |
| 31 | - <?php if ( $course_item->is_preview() ) : ?> | |
| 32 | - <span class="item-meta course-item-preview" data-preview="<?php esc_attr_e( 'Preview', 'learnpress' ); ?>"></span> | |
| 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> | |
| 33 | 41 | <?php endif; ?> |
| 34 | - | |
| 35 | - <span class="item-meta course-item-status" title="<?php echo esc_attr( $course_item->get_status_title() ); ?>"></span> | |
| 36 | 42 | |
| 37 | 43 | <?php do_action( 'learn-press/course-section-item/after-' . $course_item->get_item_type() . '-meta', $course_item ); ?> |
| 38 | 44 | </div> |
| 39 | 45 | </a> |