1 <?php
2
3 4 5 6 7
8
9 namespace nk2580\wordsmith\Inputs\Fields;
10
11 use nk2580\wordsmith\Inputs\Input as Input;
12
13 14 15 16 17
18 class TextAreaField extends Input {
19
20 public function printField() {
21 $class = $this->getClassString();
22 echo '<label for="' . $this->name . '" >' . $this->label . ' ';
23 echo '<textarea class="' . $class . '" name="' . $this->name . '" id="' . $this->name . '">';
24 echo $this->value;
25 echo '</textarea></label>';
26 echo '<br/>';
27 }
28
29 public function isFieldValid() {
30 if (strlen($this->value) > 0) {
31 return true;
32 } else {
33 return false;
34 }
35 }
36
37 public function sanitize() {
38 return sanitize_text_field($this->value);
39 }
40
41 }
42