bio.php
5 years ago
courses_taken.php
5 years ago
enrolled_course.php
5 years ago
reviews_wrote.php
5 years ago
enrolled_course.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package TutorLMS/Templates |
| 4 | * @version 1.4.3 |
| 5 | */ |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) |
| 8 | exit; |
| 9 | |
| 10 | $show_enrolled_course = tutor_utils()->get_option('show_courses_completed_by_student'); |
| 11 | if ( ! $show_enrolled_course){ |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | $user_name = sanitize_text_field(get_query_var('tutor_student_username')); |
| 16 | $get_user = tutor_utils()->get_user_by_login($user_name); |
| 17 | $user_id = $get_user->ID; |
| 18 | |
| 19 | $my_courses = tutor_utils()->get_enrolled_courses_by_user($user_id); |
| 20 | ?> |
| 21 | |
| 22 | <div class="tutor-courses "> |
| 23 | <?php |
| 24 | if ($my_courses && $my_courses->have_posts()): |
| 25 | while ($my_courses->have_posts()): |
| 26 | $my_courses->the_post(); |
| 27 | /** |
| 28 | * @hook tutor_course/archive/before_loop_course |
| 29 | * @type action |
| 30 | * Usage Idea, you may keep a loop within a wrap, such as bootstrap col |
| 31 | */ |
| 32 | do_action('tutor_course/archive/before_loop_course'); |
| 33 | |
| 34 | tutor_load_template('loop.course'); |
| 35 | |
| 36 | /** |
| 37 | * @hook tutor_course/archive/after_loop_course |
| 38 | * @type action |
| 39 | * Usage Idea, If you start any div before course loop, you can end it here, such as </div> |
| 40 | */ |
| 41 | do_action('tutor_course/archive/after_loop_course'); |
| 42 | |
| 43 | endwhile; |
| 44 | wp_reset_postdata(); |
| 45 | else : ?> |
| 46 | <div> |
| 47 | <p><?php _e("No course yet." , 'tutor'); ?></p> |
| 48 | </div> |
| 49 | <?php endif; ?> |
| 50 | </div> |
| 51 | |
| 52 |