PluginProbe
Tutor LMS – eLearning and online course solution / 2.7.5
Tutor LMS – eLearning and online course solution v2.7.5
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
tutor / templates / single / video / video.php
video.php
44 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 * Display Video
4 *
5 * @package Tutor\Templates
6 * @subpackage Single\Video
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.0.0
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 $video_info = tutor_utils()->get_video_info();
17
18 do_action( 'tutor_lesson/single/before/video' );
19
20 $source_key = is_object( $video_info ) && 'html5' !== $video_info->source ? 'source_' . $video_info->source : null;
21
22 $has_source = ( is_object( $video_info ) && $video_info->source_video_id ) || ( isset( $source_key ) ? $video_info->$source_key : null );
23
24 if ( $has_source ) {
25 tutor_load_template( 'single.video.' . $video_info->source );
26 } else {
27 $feature_image = get_post_meta( get_the_ID(), '_thumbnail_id', true );
28 $url = $feature_image ? wp_get_attachment_url( $feature_image ) : null;
29 if ( $url ) {
30 $html_markup = '<div class="tutor-lesson-feature-image">
31 <img src="' . $url . '" />
32 </div>';
33 echo wp_kses(
34 $html_markup,
35 array(
36 'div' => array( 'class' => true ),
37 'img' => array( 'src' => true ),
38 )
39 );
40 }
41 }
42
43 do_action( 'tutor_lesson/single/after/video' );
44