| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying thumbnail of single course. |
| 4 |
* |
| 5 |
* Do not use in LP4. |
| 6 |
* Will remove after LearnPress and Eduma and all guest update 4.0.0 |
| 7 |
* |
| 8 |
* @author ThimPress |
| 9 |
* @package Learnpress/Templates |
| 10 |
* @version 3.0.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* Prevent loading this file directly |
| 15 |
*/ |
| 16 |
defined( 'ABSPATH' ) || exit(); |
| 17 |
|
| 18 |
global $post; |
| 19 |
|
| 20 |
$course = learn_press_get_course(); |
| 21 |
|
| 22 |
if ( ! has_post_thumbnail() ) { |
| 23 |
return; |
| 24 |
} |
| 25 |
?> |
| 26 |
|
| 27 |
<div class="course-thumbnail"> |
| 28 |
<?php |
| 29 |
$image_title = get_the_title( get_post_thumbnail_id() ) ? esc_attr( get_the_title( get_post_thumbnail_id() ) ) : ''; |
| 30 |
$image_caption = get_post( get_post_thumbnail_id() ) ? esc_attr( get_post( get_post_thumbnail_id() )->post_excerpt ) : '""'; |
| 31 |
$image_link = wp_get_attachment_url( get_post_thumbnail_id() ); |
| 32 |
$image = get_the_post_thumbnail( |
| 33 |
$post->ID, |
| 34 |
apply_filters( 'single_course_image_size', 'single_course' ), |
| 35 |
array( |
| 36 |
'title' => $image_title, |
| 37 |
'alt' => $image_title, |
| 38 |
) |
| 39 |
); |
| 40 |
|
| 41 |
echo apply_filters( |
| 42 |
'learn_press_single_course_image_html', |
| 43 |
sprintf( '<a href="%s" class="learn-press-single-thumbnail" title="%s">%s</a>', $image_link, $image_caption, $image ), |
| 44 |
$post->ID |
| 45 |
); |
| 46 |
?> |
| 47 |
</div> |
| 48 |
|