Completed
Push — develop ( aa8228...88124f )
by David
02:48
created

Wordlift_Metabox_Field_Multiline::html_input()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
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" style="width:10 % ">Remove</button>
32
			</div>
33
EOF;
34
35
		return $html;
36
	}
37
}
38