Yoast_Form::hidden PHP 메소드

hidden() 공개 메소드

Create a hidden input field.
public hidden ( string $var, string $id = '' )
$var string The variable within the option to create the hidden input for.
$id string The ID of the element.
    public function hidden($var, $id = '')
    {
        $val = isset($this->options[$var]) ? $this->options[$var] : '';
        if (is_bool($val)) {
            $val = $val === true ? 'true' : 'false';
        }
        if ('' === $id) {
            $id = 'hidden_' . $var;
        }
        echo '<input type="hidden" id="' . esc_attr($id) . '" name="' . esc_attr($this->option_name) . '[' . esc_attr($var) . ']" value="' . esc_attr($val) . '"/>';
    }