| 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-archive-courses"> |
| 20 |
<ul <?php lp_item_course_class( array( 'profile-courses-list' ) ); ?> data-layout="grid" data-size="3"> |
| 21 |
<?php endif; ?> |
| 22 |
|
| 23 |
<?php |
| 24 |
global $post; |
| 25 |
|
| 26 |
foreach ( $course_ids as $id ) { |
| 27 |
$course = learn_press_get_course( $id ); |
| 28 |
$post = get_post( $id ); |
| 29 |
setup_postdata( $post ); |
| 30 |
|
| 31 |
//$course_data = $user->get_course_data( $id ); |
| 32 |
//$course_results = $course_data->get_result(); |
| 33 |
learn_press_get_template( 'content-course.php' ); |
| 34 |
} |
| 35 |
|
| 36 |
wp_reset_postdata(); |
| 37 |
?> |
| 38 |
|
| 39 |
<?php if ( $current_page === 1 ) : ?> |
| 40 |
</ul> |
| 41 |
</div> |
| 42 |
<?php endif; ?> |
| 43 |
|
| 44 |
<?php if ( $num_pages > 1 && $current_page < $num_pages && $current_page === 1 ) : ?> |
| 45 |
<div class="lp_profile_course_progress__nav"> |
| 46 |
<button class="lp-button" data-paged="<?php echo absint( $current_page + 1 ); ?>" |
| 47 |
data-number="<?php echo absint( $num_pages ); ?>"> |
| 48 |
<?php esc_html_e( 'View more', 'learnpress' ); ?> |
| 49 |
</button> |
| 50 |
</div> |
| 51 |
<?php endif; ?> |
| 52 |
|