1 <?php
2
3 /**
4 * Hidden input field.
5 *
6 * @package Fieldmanager_Field
7 */
8 class Fieldmanager_Hidden extends Fieldmanager_Field {
9
10 /**
11 * @var string
12 * Override field_class
13 */
14 public $field_class = 'hidden';
15
16 /**
17 * Hidden form element
18 * @param mixed $value
19 * @return string HTML
20 */
21 public function form_element( $value = '' ) {
22 return sprintf(
23 '<input class="fm-element" type="hidden" name="%s" id="%s" value="%s" %s />',
24 esc_attr( $this->get_form_name() ),
25 esc_attr( $this->get_element_id() ),
26 esc_attr( $value ),
27 $this->get_element_attributes()
28 );
29 }
30
31 }