courses_taken.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package TutorLMS/Templates |
| 4 | * @version 1.4.3 |
| 5 | */ |
| 6 | |
| 7 | $user_name = sanitize_text_field( get_query_var( 'tutor_profile_username' ) ); |
| 8 | $get_user = tutor_utils()->get_user_by_login( $user_name ); |
| 9 | $user_id = $get_user->ID; |
| 10 | |
| 11 | $pageposts = tutor_utils()->get_courses_by_instructor( $user_id ); |
| 12 | ?> |
| 13 | <div class="tutor-grid tutor-grid-3"> |
| 14 | <?php |
| 15 | if ( $pageposts ) { |
| 16 | global $post; |
| 17 | |
| 18 | foreach ( $pageposts as $post ) { |
| 19 | setup_postdata( $post ); |
| 20 | |
| 21 | /** |
| 22 | * @hook tutor_course/archive/before_loop_course |
| 23 | * @type action |
| 24 | * Usage Idea, you may keep a loop within a wrap, such as bootstrap col |
| 25 | */ |
| 26 | do_action( 'tutor_course/archive/before_loop_course' ); |
| 27 | |
| 28 | tutor_load_template( 'loop.course' ); |
| 29 | |
| 30 | /** |
| 31 | * @hook tutor_course/archive/after_loop_course |
| 32 | * @type action |
| 33 | * Usage Idea, If you start any div before course loop, you can end it here, such as </div> |
| 34 | */ |
| 35 | do_action( 'tutor_course/archive/after_loop_course' ); |
| 36 | } |
| 37 | } else { |
| 38 | ?> |
| 39 | <p><?php _e( 'No course yet.', 'tutor' ); ?></p> |
| 40 | <?php |
| 41 | } |
| 42 | ?> |
| 43 | </div> |