Completed
Branch master (136588)
by
unknown
02:26
created

Auto_Load_Next_Post_Arbitrary_Control   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ALNP_Arbitrary_Control::render_content() 0 16 4
1
<?php
2
/**
3
 * Auto Load Next Post: Customizer Controller for custom arbitrary html control for dividers etc.
4
 *
5
 * @since    1.5.0
6
 * @author   Sébastien Dumont
7
 * @category Customizer
8
 * @package  Auto Load Next Post/Customizer/Controller
9
 * @license  GPL-2.0+
10
 */
11
12
// Exit if accessed directly.
13
if ( ! defined( 'ABSPATH' ) ) {
14
	exit;
15
}
16
17
// Exit if WP_Customize_Control does not exsist.
18
if ( ! class_exists( 'WP_Customize_Control' ) ) {
19
	return null;
20
}
21
22
if ( !class_exists( 'ALNP_Arbitrary_Control' ) ) {
23
24
	/**
25
	 * The 'alnp_arbitrary' for Auto Load Next Post Arbitrary control class.
26
	 */
27
	class ALNP_Arbitrary_Control extends WP_Customize_Control {
28
29
		/**
30
		 * Renter the control
31
		 *
32
		 * @return void
33
		 */
34
		public function render_content() {
35
			switch ( $this->type ) {
36
				default:
37
				case 'text':
38
					echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
39
					break;
40
41
				case 'heading':
42
					echo '<span class="customize-control-title">' . $this->label . '</span>';
43
					break;
44
45
				case 'divider':
46
					echo '<hr style="margin: 1em 0;" />';
47
					break;
48
			}
49
		} // END render_content()
50
51
	} // END class
52
53
} // END if class
54