tutor-instructor.php
39 lines
| 1 | <div class="tutor-pagination-wrapper-replaceable tutor-instructor-list-wrapper"> |
| 2 | <?php if ( count( $instructors ) ) : ?> |
| 3 | <div class="tutor-instructor-list"> |
| 4 | <div class="tutor-grid tutor-grid-<?php echo esc_attr( $column_count ); ?>"> |
| 5 | <?php foreach ( $instructors as $instructor ) : ?> |
| 6 | <?php |
| 7 | $instructor->course_count = tutor_utils()->get_course_count_by_instructor( $instructor->ID ); |
| 8 | $instructor->ratings = tutor_utils()->get_instructor_ratings( $instructor->ID ); |
| 9 | tutor_load_template( 'instructor.' . $layout, array( |
| 10 | 'instructor' => $instructor |
| 11 | )); |
| 12 | ?> |
| 13 | <?php endforeach; ?> |
| 14 | </div> |
| 15 | </div> |
| 16 | <?php else : ?> |
| 17 | <?php tutor_utils()->tutor_empty_state( 'No Instructor Found', 'tutor' ); ?> |
| 18 | <?php endif; ?> |
| 19 | |
| 20 | <?php |
| 21 | // @todo: convert to pagination |
| 22 | if ($current_page > 1 || $instructors_count>$limit) { |
| 23 | $pagination_data = array( |
| 24 | 'total_items' => $instructors_count, |
| 25 | 'per_page' => $limit, |
| 26 | 'paged' => $current_page, |
| 27 | 'ajax' => array_merge($filter, array( |
| 28 | 'loading_container' => '.tutor-instructor-list-wrapper', |
| 29 | 'action' => 'load_filtered_instructor', |
| 30 | )) |
| 31 | ); |
| 32 | |
| 33 | tutor_load_template_from_custom_path( |
| 34 | tutor()->path . 'templates/dashboard/elements/pagination.php', |
| 35 | $pagination_data |
| 36 | ); |
| 37 | } |
| 38 | ?> |
| 39 | </div> |