1 | <?php |
||
9 | class Html_Field extends Field { |
||
10 | |||
11 | /** |
||
12 | * HTML contents to display |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | public $field_html = ''; |
||
17 | |||
18 | /** |
||
19 | * Set the field HTML or callback that returns the HTML. |
||
20 | * @param string|callable $callback_or_html HTML or callable that returns the HTML. |
||
21 | */ |
||
22 | public function set_html( $callback_or_html ) { |
||
31 | |||
32 | /** |
||
33 | * Returns an array that holds the field data, suitable for JSON representation. |
||
34 | * |
||
35 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
||
36 | * @return array |
||
37 | */ |
||
38 | public function to_json( $load ) { |
||
47 | |||
48 | /** |
||
49 | * Whether this field is required. |
||
50 | * The HTML field is non-required by design. |
||
51 | * |
||
52 | * @return false |
||
53 | */ |
||
54 | public function is_required() { |
||
57 | |||
58 | /** |
||
59 | * Load the field value. |
||
60 | * Skipped, no value to be loaded. |
||
61 | */ |
||
62 | public function load() { |
||
65 | |||
66 | /** |
||
67 | * Save the field value. |
||
68 | * Skipped, no value to be saved. |
||
69 | */ |
||
70 | public function save() { |
||
73 | |||
74 | /** |
||
75 | * Delete the field value. |
||
76 | * Skipped, no value to be deleted. |
||
77 | */ |
||
78 | public function delete() { |
||
81 | } |
||
82 |