PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
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.1.7, at templates/single-course/sidebar/user-time.php

47 lines 1.5 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.1
8 */
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * @var string $status
14 * @var LP_Datetime $start_time
15 * @var LP_Datetime $end_time
16 * @var LP_Datetime $expiration_time
17 */
18 $time = current_time( 'mysql', true );
19 $user = learn_press_get_current_user();
20 $course = learn_press_get_course();
21 ?>
22
23 <div class="course-time">
24 <p class="course-time-row">
25 <strong><?php esc_html_e( 'You started on:', 'learnpress' ); ?></strong>
26 <time class="entry-date enrolled"><?php echo esc_html( $start_time->format( 'i18n' ) ); ?></time>
27 </p>
28 <?php if ( in_array( $status, array( learn_press_user_item_in_progress_slug(), 'enrolled' ) ) ) : ?>
29 <?php if ( $expiration_time ) : ?>
30 <p class="course-time-row">
31 <strong><?php esc_html_e( 'Course will end:', 'learnpress' ); ?></strong>
32 <time class="entry-date expire"><?php echo esc_html( $expiration_time->format( 'i18n' ) ); ?></time>
33 </p>
34 <?php else : ?>
35 <p class="course-time-row">
36 <strong><?php esc_html_e( 'Duration:', 'learnpress' ); ?></strong>
37 <?php esc_html_e( 'Lifetime', 'learnpress' ); ?>
38 </p>
39 <?php endif; ?>
40 <?php elseif ( $status === 'finished' && $end_time ) : ?>
41 <p class="course-time-row">
42 <strong><?php esc_html_e( 'You finished on:', 'learnpress' ); ?></strong>
43 <time class="entry-date finished"><?php echo esc_html( $end_time->format( 'i18n' ) ); ?></time>
44 </p>
45 <?php endif; ?>
46 </div>
47