PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / templates / single-course / thumbnail.php

thumbnail.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at templates/single-course/thumbnail.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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