attachments.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display attachments |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * @author themeum |
| 7 | * @url https://themeum.com |
| 8 | */ |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) |
| 11 | exit; |
| 12 | |
| 13 | $attachments = tutor_utils()->get_attachments(); |
| 14 | do_action('tutor_global/before/attachments'); |
| 15 | |
| 16 | if (is_array($attachments) && count($attachments)){ |
| 17 | ?> |
| 18 | <div class="tutor-page-segment tutor-attachments-wrap"> |
| 19 | <h3><?php _e('Attachments', 'tutor'); ?></h3> |
| 20 | <?php |
| 21 | foreach ($attachments as $attachment){ |
| 22 | ?> |
| 23 | <a href="<?php echo $attachment->url; ?>" class="tutor-lesson-attachment clearfix"> |
| 24 | <div class="tutor-attachment-icon"> |
| 25 | <i class="tutor-icon-<?php echo $attachment->icon; ?>"></i> |
| 26 | </div> |
| 27 | <div class="tutor-attachment-info"> |
| 28 | <span><?php echo $attachment->name; ?></span> |
| 29 | <span><?php echo $attachment->size; ?></span> |
| 30 | </div> |
| 31 | </a> |
| 32 | <?php |
| 33 | } |
| 34 | ?> |
| 35 | </div> |
| 36 | <?php } |
| 37 | |
| 38 | do_action('tutor_global/after/attachments'); ?> |