-
Notifications
You must be signed in to change notification settings - Fork 21
/
class-textarea_custom_control.php
66 lines (58 loc) · 1.49 KB
/
class-textarea_custom_control.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Customize for textarea, extend the WP customizer
*
* @package WordPress
* @subpackage Wordpress-Theme-Customizer-Custom-Controls
* @see https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
* @since 10/16/2012
* @author Frank Bültge <[email protected]>
*/
if ( ! class_exists( 'WP_Customize_Control' ) )
return NULL;
class Textarea_Custom_Control extends WP_Customize_Control {
/**
* @access public
* @var string
*/
public $type = 'textarea';
/**
* @access public
* @var array
*/
public $statuses;
/**
* Constructor.
*
* If $args['settings'] is not defined, use the $id as the setting ID.
*
* @since 10/16/2012
* @uses WP_Customize_Control::__construct()
* @param WP_Customize_Manager $manager
* @param string $id
* @param array $args
* @return void
*/
public function __construct( $manager, $id, $args = array() ) {
$this->statuses = array( '' => __( 'Default' ) );
parent::__construct( $manager, $id, $args );
}
/**
* Render the control's content.
*
* Allows the content to be overriden without having to rewrite the wrapper.
*
* @since 10/16/2012
* @return void
*/
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<textarea class="large-text" cols="20" rows="5" <?php $this->link(); ?>>
<?php echo esc_textarea( $this->value() ); ?>
</textarea>
</label>
<?php
}
}