ALNP_Display_Video_Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render_content() 0 9 1
1
<?php
2
/**
3
 * Auto Load Next Post: Customizer Controller for Displaying a Video.
4
 *
5
 * @see https://developer.wordpress.org/reference/classes/wp_customize_control/
6
 *
7
 * @since    1.5.0
8
 * @author   Sébastien Dumont
9
 * @category Customizer
10
 * @package  Auto Load Next Post/Customizer/Controller
11
 * @license  GPL-2.0+
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
// Exit if WP_Customize_Control does not exsist.
20
if ( ! class_exists( 'WP_Customize_Control' ) ) {
21
	return null;
22
}
23
24
if ( !class_exists( 'ALNP_Display_Video_Controller' ) ) {
25
26
	/**
27
	 * This class is for the display video control in the Customizer.
28
	 */
29
	class ALNP_Display_Video_Controller extends WP_Customize_Control {
30
31
		/**
32
		 * The type of customize control.
33
		 *
34
		 * @access public
35
		 * @since  1.5.0
36
		 * @var    string
37
		 */
38
		public $type = 'alnp-display-video';
39
40
		/**
41
		 * Render the content on the theme customizer page via PHP.
42
		 *
43
		 * @access public
44
		 * @since  1.5.0
45
		 */
46
		public function render_content() {
47
			?>
48
			<span class="customize-control-title"><?php echo $this->label; ?></span>
49
50
			<p>
51
				<iframe width="320" height="180" src="https://www.youtube-nocookie.com/embed/<?php echo $this->value(); ?>?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
52
			</p>
53
			<?php
54
		} // END render_content()
55
56
	} // END class
57
58
} // END if class
59