PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / templates / single-course / sidebar / user-time.php

user-time.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at templates/single-course/sidebar/user-time.php

52 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying user time on course.
4 *
5 * @author ThimPress
6 * @package LearnPress/Templates
7 * @version 4.0.2
8 */
9
10 defined( 'ABSPATH' ) || exit;
11
12 if ( ! isset( $data ) || ! isset( $data['start_time'] ) || ! isset( $data['end_time'] )
13 || ! isset( $data['status'] ) || ! isset( $data['expiration_time'] ) ) {
14 return;
15 }
16
17 /**
18 * @var LP_Datetime $start_time
19 * @var LP_Datetime $end_time
20 * @var LP_Datetime $expiration_time
21 */
22 $start_time = $data['start_time'];
23 $end_time = $data['end_time'];
24 $status = $data['status'];
25 $expiration_time = $data['expiration_time'];
26 ?>
27
28 <div class="course-time">
29 <p class="course-time-row">
30 <strong><?php esc_html_e( 'You started on:', 'learnpress' ); ?></strong>
31 <time class="entry-date enrolled"><?php echo esc_html( $start_time->format( 'i18n' ) ); ?></time>
32 </p>
33 <?php if ( in_array( $status, array( learn_press_user_item_in_progress_slug(), 'enrolled' ) ) ) : ?>
34 <?php if ( $expiration_time ) : ?>
35 <p class="course-time-row">
36 <strong><?php esc_html_e( 'Course will end:', 'learnpress' ); ?></strong>
37 <time class="entry-date expire"><?php echo esc_html( $expiration_time->format( 'i18n' ) ); ?></time>
38 </p>
39 <?php else : ?>
40 <p class="course-time-row">
41 <strong><?php esc_html_e( 'Duration:', 'learnpress' ); ?></strong>
42 <?php esc_html_e( 'Lifetime', 'learnpress' ); ?>
43 </p>
44 <?php endif; ?>
45 <?php elseif ( $status === 'finished' && $end_time ) : ?>
46 <p class="course-time-row">
47 <strong><?php esc_html_e( 'You finished on:', 'learnpress' ); ?></strong>
48 <time class="entry-date finished"><?php echo esc_html( $end_time->format( 'i18n' ) ); ?></time>
49 </p>
50 <?php endif; ?>
51 </div>
52