Completed
Push — master ( 37bdb3...5c343e )
by David
03:17 queued 10s
created

Wordlift_Metabox_Field_Multiline   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A html_input() 0 13 1
1
<?php
2
/**
3
 * Metaxboxes: Multiline text Field.
4
 *
5
 * This file defines the Wordlift_Metabox_Field_Multiline class which displays a texttarea field
6
 * in WordPress' entity posts pages.
7
 *
8
 * @since   3.14.0
9
 * @package Wordlift
10
 */
11
12
/**
13
 * The Wordlift_Metabox_Field_Multiline class extends {@link WL_Metabox_Field} and provides
14
 * support for time duration fields.
15
 *
16
 * @since   3.14.0
17
 * @package Wordlift
18
 */
19
class Wordlift_Metabox_Field_Multiline extends WL_Metabox_Field {
20
21
	/**
22
	 * @inheritdoc
23
	 */
24
	public function html_input( $text ) {
25
26
		$esc_text      = esc_textarea( $text );
27
		$esc_meta_name = esc_attr( $this->meta_name );
28
		$html          = <<<EOF
29
			<div class="wl-input-wrapper">
30
				<textarea id="$esc_meta_name" class="$esc_meta_name" name="wl_metaboxes[$esc_meta_name][]" style="width:88%">$esc_text</textarea>
31
				<button class="button wl-remove-input wl-button" type="button">Remove</button>
32
			</div>
33
EOF;
34
35
		return $html;
36
	}
37
}
38