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 / profile / tabs / courses / course-list.php

course-list.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at templates/profile/tabs/courses/course-list.php

72 lines 2.1 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 own courses in courses tab of user profile page.
4 * Edit by Nhamdv
5 *
6 * @author ThimPress
7 * @package Learnpress/Templates
8 * @version 4.0.10
9 */
10
11 defined( 'ABSPATH' ) || exit();
12
13 if ( ! isset( $user ) || ! isset( $course_ids ) || ! isset( $current_page ) || ! isset( $num_pages ) ) {
14 return;
15 }
16 ?>
17
18 <?php if ( $current_page === 1 ) : ?>
19 <div class="lp_profile_course_progress">
20 <div class="lp_profile_course_progress__item lp_profile_course_progress__header">
21 <div></div>
22 <div><?php esc_html_e( 'Name', 'learnpress' ); ?></div>
23 <div><?php esc_html_e( 'Result', 'learnpress' ); ?></div>
24 <div><?php esc_html_e( 'Expiration time', 'learnpress' ); ?></div>
25 <div><?php esc_html_e( 'End time', 'learnpress' ); ?></div>
26 </div>
27 <?php endif; ?>
28
29 <?php
30 global $post;
31
32 foreach ( $course_ids as $id ) {
33 $course = learn_press_get_course( $id );
34
35 if ( ! $course ) {
36 continue;
37 }
38
39 $post = get_post( $id );
40 setup_postdata( $post );
41
42 $course_data = $user->get_course_data( $id );
43 $course_result = $course_data->get_result();
44 ?>
45 <div class="lp_profile_course_progress__item">
46 <div>
47 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
48 <?php echo wp_kses_post( $course->get_image( 'course_thumbnail' ) ); ?>
49 </a>
50 </div>
51 <div><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
52 <div><?php echo esc_html( $course_result['result'] ); ?>%</div>
53 <div><?php echo ! empty( $course_data->get_expiration_time() ) ? $course_data->get_expiration_time() : '-'; ?></div>
54 <div><?php echo ! empty( $course_data->get_end_time() ) ? $course_data->get_end_time() : '-'; ?></div>
55 </div>
56 <?php
57 }
58
59 wp_reset_postdata();
60 ?>
61
62 <?php if ( $current_page === 1 ) : ?>
63 </div>
64 <?php endif; ?>
65
66 <?php if ( $num_pages > 1 && $current_page < $num_pages && $current_page === 1 ) : ?>
67 <div class="lp_profile_course_progress__nav">
68 <button data-paged="<?php echo absint( $current_page + 1 ); ?>"
69 data-number="<?php echo absint( $num_pages ); ?>"><?php esc_html_e( 'View more', 'learnpress' ); ?></button>
70 </div>
71 <?php endif; ?>
72