Example #1
1
function cf7bs_number_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    $class .= ' wpcf7-validates-as-number';
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    if ($tag->is_required()) {
        $mode = 'required';
    }
    $value = (string) reset($tag->values);
    $placeholder = '';
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $placeholder = $value;
        $value = '';
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    } elseif (isset($_GET) && array_key_exists($tag->name, $_GET)) {
        $value = stripslashes_deep(rawurldecode($_GET[$tag->name]));
    }
    $field = new CF7BS_Form_Field(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => wpcf7_support_html5() ? $tag->basetype : 'text', 'value' => $value, 'placeholder' => $placeholder, 'label' => $tag->content, 'options' => array('min' => $tag->get_option('min', 'signed_int', true), 'max' => $tag->get_option('max', 'signed_int', true), 'step' => $tag->get_option('step', 'int', true)), 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'readonly' => $tag->has_option('readonly') ? true : false, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name));
    $html = $field->display(false);
    return $html;
}
function wpcf7_map_shorcode_handler($tag)
{
    if (!is_array($tag)) {
        return '';
    }
    $type = $tag['type'];
    $name = $tag['name'];
    if (empty($name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($name);
    $atts = '';
    $class_att = '';
    $class_att = wpcf7_form_controls_class($type);
    if ($validation_error) {
        $class_att .= ' wpcf7-not-valid';
    }
    if ($class_att) {
        $atts .= ' class="' . trim($class_att) . '"';
    }
    $folder = dirname(__FILE__);
    $codeFile = "{$folder}/map-code-leaflet.html";
    $fh = fopen($codeFile, 'r');
    $theCode = fread($fh, filesize($codeFile));
    fclose($fh);
    $html = '<span class="wpcf7-form-control-wrap ' . $name . '">' . $theCode . $validation_error . '<input id="CF7MapLocationHidden" type="hidden" ' . $atts . ' name="' . $name . '" /></span>';
    return $html;
}
Example #3
0
function wpcf7_honeypot_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class('text');
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['message'] = __('Please leave this field empty.', 'wpcf7_honeypot');
    $atts['name'] = $tag->name;
    $atts['type'] = $tag->type;
    $atts['nomessage'] = $tag->get_option('nomessage');
    $atts['validation_error'] = $validation_error;
    $inputid = !empty($atts['id']) ? 'id="' . $atts['id'] . '" ' : '';
    $html = '<span class="wpcf7-form-control-wrap ' . $atts['name'] . '-wrap" style="display:none !important;visibility:hidden !important;">';
    $html .= '<input ' . $inputid . 'class="' . $atts['class'] . '"  type="text" name="' . $atts['name'] . '" value="" size="40" tabindex="-1" />';
    if (!$atts['nomessage']) {
        $html .= '<span class="hp-message">' . $atts['message'] . '</span>';
    }
    $html .= $validation_error . '</span>';
    // Hook for filtering finished Honeypot form element.
    return apply_filters('wpcf7_honeypot_html_output', $html, $atts);
}
Example #4
0
function wpcf7_acceptance_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    if ($tag->has_option('invert')) {
        $class .= ' wpcf7-invert';
    }
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->has_option('default:on')) {
        $atts['checked'] = 'checked';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $atts['type'] = 'checkbox';
    $atts['name'] = $tag->name;
    $atts['value'] = '1';
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', sanitize_html_class($tag->name), $atts, $validation_error);
    return $html;
}
function wpcf7_submit_shortcode_handler($tag)
{
    if (!is_array($tag)) {
        return '';
    }
    $options = (array) $tag['options'];
    $values = (array) $tag['values'];
    $atts = $id_att = $tabindex_att = '';
    $class_att = wpcf7_form_controls_class('submit');
    foreach ($options as $option) {
        if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $id_att = $matches[1];
        } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $class_att .= ' ' . $matches[1];
        } elseif (preg_match('%^tabindex:(\\d+)$%', $option, $matches)) {
            $tabindex_att = (int) $matches[1];
        }
    }
    if ($id_att) {
        $atts .= ' id="' . trim($id_att) . '"';
    }
    if ($class_att) {
        $atts .= ' class="' . trim($class_att) . '"';
    }
    if ('' !== $tabindex_att) {
        $atts .= sprintf(' tabindex="%d"', $tabindex_att);
    }
    $value = isset($values[0]) ? $values[0] : '';
    if (empty($value)) {
        $value = __('Send', 'wpcf7');
    }
    $html = '<input type="submit" value="' . esc_attr($value) . '"' . $atts . ' />';
    return $html;
}
function cf7bs_file_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    // size is not used since Bootstrap input fields always scale 100%
    //$atts['size'] = $tag->get_size_option( '40' );
    if ($tag->is_required()) {
        $mode = 'required';
    }
    $value = (string) reset($tag->values);
    $placeholder = '';
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $placeholder = $value;
        $value = '';
    } elseif (empty($value)) {
        $value = $tag->get_default_option();
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    }
    $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => 'file', 'value' => '1', 'label' => $tag->content, 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name), $tag->basetype, $tag->name));
    $html = $field->display(false);
    return $html;
}
function wpcf7_mathcaptcha_shortcode_handler($tag)
{
    if (!is_user_logged_in() || is_user_logged_in() && !Math_Captcha()->options['general']['hide_for_logged_users']) {
        $tag = new WPCF7_Shortcode($tag);
        if (empty($tag->name)) {
            return '';
        }
        $validation_error = wpcf7_get_validation_error($tag->name);
        $class = wpcf7_form_controls_class($tag->type);
        if ($validation_error) {
            $class .= ' wpcf7-not-valid';
        }
        $atts = array();
        $atts['size'] = 2;
        $atts['maxlength'] = 2;
        $atts['class'] = $tag->get_class_option($class);
        $atts['id'] = $tag->get_option('id', 'id', true);
        $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
        $atts['aria-required'] = 'true';
        $atts['type'] = 'text';
        $atts['name'] = $tag->name;
        $atts['value'] = '';
        $atts = wpcf7_format_atts($atts);
        $mc_form = Math_Captcha()->core->generate_captcha_phrase('cf7');
        $mc_form[$mc_form['input']] = '<input %2$s />';
        $math_captcha_title = apply_filters('math_captcha_title', Math_Captcha()->options['general']['title']);
        return sprintf((empty($math_captcha_title) ? '' : $math_captcha_title) . '<span class="wpcf7-form-control-wrap %1$s">' . $mc_form[1] . $mc_form[2] . $mc_form[3] . '%3$s</span><input type="hidden" value="' . (Math_Captcha()->core->session_number - 1) . '" name="' . $tag->name . '-sn" />', $tag->name, $atts, $validation_error);
    }
}
Example #8
0
function wpcf7_file_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['type'] = 'file';
    $atts['name'] = $tag->name;
    $atts['value'] = '1';
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', $tag->name, $atts, $validation_error);
    return $html;
}
Example #9
0
 public static function shortcode_handler($tag)
 {
     $tag = new WPCF7_Shortcode($tag);
     if (empty($tag->name)) {
         return '';
     }
     $validation_error = wpcf7_get_validation_error($tag->name);
     $class = wpcf7_form_controls_class($tag->type, 'wpcf7-date');
     if ($validation_error) {
         $class .= ' wpcf7-not-valid';
     }
     $atts = array();
     $atts['size'] = $tag->get_size_option('40');
     $atts['maxlength'] = $tag->get_maxlength_option();
     $atts['class'] = $tag->get_class_option($class);
     $atts['id'] = $tag->get_option('id', 'id', true);
     $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
     $atts['type'] = 'text';
     if ($tag->has_option('readonly')) {
         $atts['readonly'] = 'readonly';
     }
     if ($tag->is_required()) {
         $atts['aria-required'] = 'true';
     }
     $value = (string) reset($tag->values);
     if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
         $atts['placeholder'] = $value;
         $value = '';
     }
     if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
         $value = stripslashes_deep($_POST[$tag->name]);
     }
     $atts['value'] = $value;
     $dpOptions = array();
     $dpOptions['dateFormat'] = str_replace('_', ' ', $tag->get_option('date-format', '', true));
     $dpOptions['minDate'] = $tag->get_option('min-date', '', true);
     $dpOptions['maxDate'] = $tag->get_option('max-date', '', true);
     $dpOptions['firstDay'] = (int) $tag->get_option('first-day', 'int', true);
     $dpOptions['showAnim'] = $tag->get_option('animate', '', true);
     $dpOptions['yearRange'] = str_replace('-', ':', $tag->get_option('year-range', '', true));
     $dpOptions['numberOfMonths'] = (int) $tag->get_option('months', 'int', true);
     $dpOptions['showButtonPanel'] = $tag->has_option('buttons');
     $dpOptions['changeMonth'] = $tag->has_option('change-month');
     $dpOptions['changeYear'] = $tag->has_option('change-year');
     $dpOptions['noWeekends'] = $tag->has_option('no-weekends');
     $inline = $tag->has_option('inline');
     if ($inline) {
         $dpOptions['altField'] = "#{$tag->name}_alt";
         $atts['id'] = "{$tag->name}_alt";
     }
     $atts['type'] = $inline ? 'hidden' : 'text';
     $atts['name'] = $tag->name;
     $atts = wpcf7_format_atts($atts);
     $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s %4$s</span>', $tag->name, $atts, $validation_error, $inline ? "<div id=\"{$tag->name}_datepicker\"></div>" : '');
     $html = apply_filters('cf7dp_date_input', $html);
     $dp_selector = $inline ? '#' . $tag->name . '_datepicker' : $tag->name;
     $dp = new CF7_DateTimePicker('date', $dp_selector, $dpOptions);
     self::$inline_js[] = $dp->generate_code($inline);
     return $html;
 }
Example #10
0
function wpcf7_quiz_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $atts['aria-required'] = 'true';
    $pipes = $tag->pipes;
    if (is_a($pipes, 'WPCF7_Pipes') && !$pipes->zero()) {
        $pipe = $pipes->random_pipe();
        $question = $pipe->before;
        $answer = $pipe->after;
    } else {
        // default quiz
        $question = '1+1=?';
        $answer = '2';
    }
    $answer = wpcf7_canonicalize($answer);
    $atts['type'] = 'text';
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><span class="wpcf7-quiz-label">%2$s</span>&nbsp;<input %3$s /><input type="hidden" name="_wpcf7_quiz_answer_%1$s" value="%4$s" />%5$s</span>', $tag->name, esc_html($question), $atts, wp_hash($answer, 'wpcf7_quiz'), $validation_error);
    return $html;
}
Example #11
0
 function wpcf7_icon_btn_shortcode_handler($tag)
 {
     $tag = new WPCF7_Shortcode($tag);
     $class = wpcf7_form_controls_class($tag->type);
     $atts = array();
     $atts['class'] = $tag->get_class_option($class);
     $atts['class'] = $atts['class'] . ' wpcf7-submit';
     //add the default submit class
     $atts['id'] = $tag->get_id_option();
     $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
     $atts['type'] = 'submit';
     $atts = wpcf7_format_atts($atts);
     //get icon class
     $icon_class = $tag->get_option('icon', '', true);
     $icon_class = empty($icon_class) ? 'fa-send' : $icon_class;
     //add default class if empty
     $icon_class = 'fa ' . esc_attr($icon_class);
     //add fa // did u notice space after fa
     //get button label
     $value = isset($tag->values[0]) ? $tag->values[0] : '';
     if (empty($value)) {
         $value = __('Send', 'contact-form-7');
     }
     //complete string
     $html = sprintf('<button %1$s /><i class="%2$s"></i> %3$s</button>', $atts, $icon_class, esc_html($value));
     return $html;
 }
function wpcf7dtx_dynamictext_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type, 'wpcf7dtx-dynamictext');
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['minlength'] = $tag->get_minlength_option();
    if ($atts['maxlength'] && $atts['minlength'] && $atts['maxlength'] < $atts['minlength']) {
        unset($atts['maxlength'], $atts['minlength']);
    }
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    }
    $value = $tag->get_default_option($value);
    $value = wpcf7_get_hangover($tag->name, $value);
    $scval = do_shortcode('[' . $value . ']');
    if ($scval != '[' . $value . ']') {
        $value = esc_attr($scval);
    }
    $atts['value'] = $value;
    //echo '<pre>'; print_r( $tag ); echo '</pre>';
    switch ($tag->basetype) {
        case 'dynamictext':
            $atts['type'] = 'text';
            break;
        case 'dynamichidden':
            $atts['type'] = 'hidden';
            break;
        default:
            $atts['type'] = 'text';
            break;
    }
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', sanitize_html_class($tag->name), $atts, $validation_error);
    return $html;
}
function cf7bs_captcha_shortcode_handler($tag)
{
    $tag_obj = new WPCF7_Shortcode($tag);
    if ('captchac' == $tag_obj->type && !class_exists('ReallySimpleCaptcha')) {
        return '<em>' . __('To use CAPTCHA, you need <a href="http://wordpress.org/extend/plugins/really-simple-captcha/">Really Simple CAPTCHA</a> plugin installed.', 'bootstrap-for-contact-form-7') . '</em>';
    }
    if (empty($tag_obj->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag_obj->name);
    if ('captchac' == $tag_obj->type) {
        if ($image_sizes_array = preg_grep('%^size:[smlSML]$%', $tag['options'])) {
            $tag['options'] = array_values(array_diff_key($tag['options'], $image_sizes_array));
        }
        $size = cf7bs_get_form_property('size');
        $image_size = 'large' == $size ? 'l' : ('small' == $size ? 's' : 'm');
        $tag['options'][] = 'size:' . $image_size;
        $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => wpcf7_captcha_shortcode_handler($tag), 'type' => 'custom', 'label' => $tag_obj->content, 'help_text' => $validation_error, 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'tabindex' => false, 'wrapper_class' => ''), $tag_obj->basetype, $tag_obj->name));
        $html = $field->display(false);
        return $html;
    } elseif ('captchar' == $tag_obj->type) {
        $mode = $status = 'default';
        $class = wpcf7_form_controls_class($tag_obj->type, 'wpcf7-text');
        if ($validation_error) {
            $class .= ' wpcf7-not-valid';
            $status = 'error';
        }
        // size is not used since Bootstrap input fields always scale 100%
        //$atts['size'] = $tag->get_size_option( '40' );
        $value = (string) reset($tag_obj->values);
        $placeholder = '';
        if (wpcf7_is_posted()) {
            $value = '';
        }
        if ($tag_obj->has_option('placeholder') || $tag_obj->has_option('watermark')) {
            $placeholder = $value;
            $value = '';
        }
        $input_before = $input_after = '';
        if ($tag_obj->has_option('include_captchac') && class_exists('ReallySimpleCaptcha')) {
            $captchac_mode = $tag_obj->get_option('include_captchac', '[A-Za-z]+', true);
            if ($captchac_mode && 'after' == strtolower($captchac_mode)) {
                $captchac_mode = 'input_after';
            } else {
                $captchac_mode = 'input_before';
            }
            $tag = cf7bs_captchar_to_captchac($tag);
            ${$captchac_mode} = wpcf7_captcha_shortcode_handler($tag);
        }
        $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => $tag_obj->name, 'id' => $tag_obj->get_option('id', 'id', true), 'class' => $tag_obj->get_class_option($class), 'type' => 'text', 'value' => $value, 'placeholder' => $placeholder, 'label' => $tag_obj->content, 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'maxlength' => $tag_obj->get_maxlength_option(), 'tabindex' => $tag_obj->get_option('tabindex', 'int', true), 'wrapper_class' => $tag_obj->name, 'input_before' => $input_before, 'input_after' => $input_after, 'input_before_class' => 'input-group-addon input-group-has-image', 'input_after_class' => 'input-group-addon input-group-has-image'), $tag_obj->basetype, $tag_obj->name));
        $html = $field->display(false);
        return $html;
    }
    return '';
}
Example #14
0
function wpcf7_text_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type, 'wpcf7-text');
    if (in_array($tag->basetype, array('email', 'url', 'tel'))) {
        $class .= ' wpcf7-validates-as-' . $tag->basetype;
    }
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    } elseif (empty($value) && is_user_logged_in()) {
        $user = wp_get_current_user();
        $user_options = array('default:user_login' => 'user_login', 'default:user_email' => 'user_email', 'default:user_url' => 'user_url', 'default:user_first_name' => 'first_name', 'default:user_last_name' => 'last_name', 'default:user_nickname' => 'nickname', 'default:user_display_name' => 'display_name');
        foreach ($user_options as $option => $prop) {
            if ($tag->has_option($option)) {
                $value = $user->{$prop};
                break;
            }
        }
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    }
    $atts['value'] = $value;
    if (wpcf7_support_html5()) {
        $atts['type'] = $tag->basetype;
    } else {
        $atts['type'] = 'text';
    }
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', $tag->name, $atts, $validation_error);
    return $html;
}
Example #15
0
function wpcf7_text_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type, 'wpcf7-text');
    if (in_array($tag->basetype, array('email', 'url', 'tel'))) {
        $class .= ' wpcf7-validates-as-' . $tag->basetype;
    }
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['minlength'] = $tag->get_minlength_option();
    if ($atts['maxlength'] && $atts['minlength'] && $atts['maxlength'] < $atts['minlength']) {
        unset($atts['maxlength'], $atts['minlength']);
    }
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $atts['autocomplete'] = $tag->get_option('autocomplete', '[-0-9a-zA-Z]+', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    }
    $value = $tag->get_default_option($value);
    $value = wpcf7_get_hangover($tag->name, $value);
    $atts['value'] = $value;
    if (wpcf7_support_html5()) {
        $atts['type'] = $tag->basetype;
    } else {
        $atts['type'] = 'text';
    }
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', sanitize_html_class($tag->name), $atts, $validation_error);
    return $html;
}
Example #16
0
function wpcf7_file_shortcode_handler($tag)
{
    if (!is_array($tag)) {
        return '';
    }
    $type = $tag['type'];
    $name = $tag['name'];
    $options = (array) $tag['options'];
    $values = (array) $tag['values'];
    if (empty($name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($name);
    $atts = $id_att = $size_att = $tabindex_att = '';
    $class_att = wpcf7_form_controls_class($type);
    if ($validation_error) {
        $class_att .= ' wpcf7-not-valid';
    }
    foreach ($options as $option) {
        if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $id_att = $matches[1];
        } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $class_att .= ' ' . $matches[1];
        } elseif (preg_match('%^([0-9]*)[/x]([0-9]*)$%', $option, $matches)) {
            $size_att = (int) $matches[1];
        } elseif (preg_match('%^tabindex:(\\d+)$%', $option, $matches)) {
            $tabindex_att = (int) $matches[1];
        }
    }
    if ($id_att) {
        $atts .= ' id="' . trim($id_att) . '"';
    }
    if ($class_att) {
        $atts .= ' class="' . trim($class_att) . '"';
    }
    if ($size_att) {
        $atts .= ' size="' . $size_att . '"';
    } else {
        $atts .= ' size="40"';
    }
    // default size
    if ('' !== $tabindex_att) {
        $atts .= sprintf(' tabindex="%d"', $tabindex_att);
    }
    $html = '<input type="file" name="' . $name . '"' . $atts . ' value="1" />';
    $html = '<span class="wpcf7-form-control-wrap ' . $name . '">' . $html . $validation_error . '</span>';
    return $html;
}
Example #17
0
function wpcf7_text_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type, 'wpcf7-text');
    if (in_array($tag->basetype, array('email', 'url', 'tel'))) {
        $class .= ' wpcf7-validates-as-' . $tag->basetype;
    }
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    } elseif (empty($value)) {
        $value = $tag->get_default_option();
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    }
    $atts['value'] = $value;
    if (wpcf7_support_html5()) {
        $atts['type'] = $tag->basetype;
    } else {
        $atts['type'] = 'text';
    }
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<input %2$s />', $tag->name, $atts, $validation_error);
    return $html;
}
function cf7bs_submit_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    $class = wpcf7_form_controls_class($tag->type);
    $value = isset($tag->values[0]) ? $tag->values[0] : '';
    if (empty($value)) {
        $value = __('Send', 'contact-form-7');
    }
    $size = cf7bs_get_form_property('submit_size');
    if (!$size) {
        $size = cf7bs_get_form_property('size');
    }
    $button = new CF7BS_Button(array('mode' => 'submit', 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'title' => $value, 'type' => cf7bs_get_form_property('submit_type'), 'size' => $size, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'align' => $tag->get_option('align', '[A-Za-z]+', true), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint')));
    $html = $button->display(false);
    return $html;
}
Example #19
0
function wpcf7_button_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    $class = wpcf7_form_controls_class($tag->type);
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $value = isset($tag->values[0]) ? $tag->values[0] : '';
    if (empty($value)) {
        $value = __('Send', 'contact-form-7');
    }
    $atts['type'] = 'submit';
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<button %1$s>%2$s</button>', $atts, $value);
    return $html;
}
Example #20
0
function wpcf7_number_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    $class .= ' wpcf7-validates-as-number';
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $atts['min'] = $tag->get_option('min', 'signed_int', true);
    $atts['max'] = $tag->get_option('max', 'signed_int', true);
    $atts['step'] = $tag->get_option('step', 'int', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = wp_unslash($_POST[$tag->name]);
    }
    $atts['value'] = $value;
    if (wpcf7_support_html5()) {
        $atts['type'] = $tag->basetype;
    } else {
        $atts['type'] = 'text';
    }
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', sanitize_html_class($tag->name), $atts, $validation_error);
    return $html;
}
Example #21
0
function wpcf7c_back_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    $class = wpcf7_form_controls_class($tag->type);
    $atts = array();
    $atts['class'] = $tag->get_class_option($class) . " wpcf7c-elm-step2 wpcf7c-btn-back wpcf7c-force-hide";
    $atts['id'] = $tag->get_option('id', 'id', true);
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $value = isset($tag->values[0]) ? $tag->values[0] : '';
    if (empty($value)) {
        $value = __('Backedit', 'contact-form-7-add-confirm');
    }
    $atts['type'] = 'button';
    $atts['value'] = $value;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<input %1$s />', $atts);
    return $html;
}
Example #22
0
function wpcf7_submit_form_tag_handler($tag)
{
    $tag = new WPCF7_FormTag($tag);
    $class = wpcf7_form_controls_class($tag->type);
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $value = isset($tag->values[0]) ? $tag->values[0] : '';
    if (empty($value)) {
        $value = __('Send', 'contact-form-7');
    }
    $atts['type'] = 'submit';
    $atts['value'] = $value;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<input %1$s />', $atts);
    return $html;
}
Example #23
0
/**
 * render wpcf7 field for counties
 * @param $tag
 */
function _hw_wcpf7_country_field_shortcode($tag)
{
    if (!is_array($tag)) {
        return '';
    }
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $multiple = $tag->has_option('multiple');
    $include_blank = $tag->has_option('include_blank');
    $first_as_label = $tag->has_option('first_as_label');
    //$values = $tag->values;
    $values = array('0' => 'Select country');
    $values = array_merge($values, hw_wpcf7_field_countries_data());
    $labels = $tag->labels;
    $html = '';
    foreach ($values as $key => $value) {
        $item_atts = array('value' => $value);
        $item_atts = wpcf7_format_atts($item_atts);
        $label = isset($labels[$key]) ? $labels[$key] : $value;
        $html .= sprintf('<option %1$s>%2$s</option>', $item_atts, esc_html($label));
    }
    if ($multiple) {
        $atts['multiple'] = 'multiple';
    }
    $atts['name'] = $tag->name . ($multiple ? '[]' : '');
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><select %2$s>%3$s</select>%4$s</span>', sanitize_html_class($tag->name), $atts, $html, $validation_error);
    return $html;
}
Example #24
0
function wpcf7_acceptance_shortcode_handler($tag)
{
    if (!is_array($tag)) {
        return '';
    }
    $type = $tag['type'];
    $name = $tag['name'];
    $options = (array) $tag['options'];
    $values = (array) $tag['values'];
    if (empty($name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($name);
    $atts = $id_att = $tabindex_att = '';
    $class_att = wpcf7_form_controls_class($type);
    if ($validation_error) {
        $class_att .= ' wpcf7-not-valid';
    }
    foreach ($options as $option) {
        if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $id_att = $matches[1];
        } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
            $class_att .= ' ' . $matches[1];
        } elseif ('invert' == $option) {
            $class_att .= ' wpcf7-invert';
        } elseif (preg_match('%^tabindex:(\\d+)$%', $option, $matches)) {
            $tabindex_att = (int) $matches[1];
        }
    }
    if ($id_att) {
        $atts .= ' id="' . trim($id_att) . '"';
    }
    if ($class_att) {
        $atts .= ' class="' . trim($class_att) . '"';
    }
    if ('' !== $tabindex_att) {
        $atts .= sprintf(' tabindex="%d"', $tabindex_att);
    }
    $default_on = (bool) preg_grep('/^default:on$/i', $options);
    $checked = $default_on ? ' checked="checked"' : '';
    $html = '<input type="checkbox" name="' . $name . '" value="1"' . $atts . $checked . ' />';
    $html = '<span class="wpcf7-form-control-wrap ' . $name . '">' . $html . $validation_error . '</span>';
    return $html;
}
function wpcf7_hashcash_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    if ($tag->type != 'hashcash') {
        return '';
    }
    $op = wpcf7_hashcash_options($tag->options);
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    $class .= ' wpcf7-hashcash-' . $tag->name;
    $atts = array();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $html = sprintf('<input type="hidden" name="_wpcf7_hashcash_complexity" value="%1$s" class="%2$s" id="%3$s" />', $op['complexity'], $atts['class'], $atts['id']);
    return $html;
}
Example #26
0
function wpcf7_hidden_form_tag_handler($tag)
{
    $tag = new WPCF7_FormTag($tag);
    if (empty($tag->name)) {
        return '';
    }
    $atts = array();
    $class = wpcf7_form_controls_class($tag->type);
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $value = (string) reset($tag->values);
    $value = $tag->get_default_option($value);
    $atts['value'] = $value;
    $atts['type'] = 'hidden';
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<input %s />', $atts);
    return $html;
}
Example #27
0
function wpcf7_textarea_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['cols'] = $tag->get_cols_option('40');
    $atts['rows'] = $tag->get_rows_option('10');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['minlength'] = $tag->get_minlength_option();
    if ($atts['maxlength'] && $atts['minlength'] && $atts['maxlength'] < $atts['minlength']) {
        unset($atts['maxlength'], $atts['minlength']);
    }
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    $atts['autocomplete'] = $tag->get_option('autocomplete', '[-0-9a-zA-Z]+', true);
    if ($tag->has_option('readonly')) {
        $atts['readonly'] = 'readonly';
    }
    if ($tag->is_required()) {
        $atts['aria-required'] = 'true';
    }
    $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
    $value = empty($tag->content) ? (string) reset($tag->values) : $tag->content;
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    }
    $value = $tag->get_default_option($value);
    $value = wpcf7_get_hangover($tag->name, $value);
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %1$s"><textarea %2$s>%3$s</textarea>%4$s</span>', sanitize_html_class($tag->name), $atts, esc_textarea($value), $validation_error);
    return $html;
}
Example #28
0
function cf7bs_acceptance_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    if ($tag->has_option('invert')) {
        $class .= ' wpcf7-invert';
    }
    $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => 'checkbox', 'value' => $tag->has_option('default:on') ? '1' : '0', 'options' => array('1' => $tag->content), 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'group_layout' => cf7bs_get_form_property('group_layout'), 'mode' => $mode, 'status' => $status, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name), $tag->basetype, $tag->name));
    $html = $field->display(false);
    return $html;
}
function wpcf7_robottrap_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    // default field name
    if (empty($tag->name)) {
        $tag->name = 'email-verify';
    }
    // per field errors
    $validation_error = wpcf7_get_validation_error($tag->name);
    // add wpcf7 specific classes
    $class = wpcf7_form_controls_class('text');
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
    }
    $atts = array();
    $atts['size'] = $tag->get_size_option('40');
    $atts['maxlength'] = $tag->get_maxlength_option();
    $atts['class'] = $tag->get_class_option($class);
    $atts['id'] = $tag->get_id_option();
    $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
    /**
     * Robots may look for the word "hidden".
     *
     * @ignore Commented out.
     */
    //$atts['aria-hidden'] = 'true';
    $value = (string) reset($tag->values);
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $atts['placeholder'] = $value;
        $value = '';
    } elseif ('' === $value) {
        $value = $tag->get_default_option();
    }
    $value = wpcf7_get_hangover($tag->name, $value);
    $atts['value'] = $value;
    $atts['type'] = 'text';
    $atts['name'] = $tag->name;
    $atts = wpcf7_format_atts($atts);
    $html = sprintf('<span class="wpcf7-form-control-wrap %s"><input %s />%s</span>', sanitize_html_class($tag->name), $atts, $validation_error);
    return $html;
}
Example #30
-1
function cf7bs_quiz_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    // size is not used since Bootstrap input fields always scale 100%
    //$atts['size'] = $tag->get_size_option( '40' );
    $pipes = $tag->pipes;
    if (is_a($pipes, 'WPCF7_Pipes') && !$pipes->zero()) {
        $pipe = $pipes->random_pipe();
        $question = $pipe->before;
        $answer = $pipe->after;
    } else {
        // default quiz
        $question = '1+1=?';
        $answer = '2';
    }
    $answer = wpcf7_canonicalize($answer);
    $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => 'text', 'value' => '', 'placeholder' => '', 'label' => $tag->content, 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'status' => $status, 'maxlength' => $tag->get_maxlength_option(), 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name), $tag->basetype, $tag->name));
    $html = $field->display(false);
    $hidden_html = sprintf('<input type="hidden" name="_wpcf7_quiz_answer_%1$s" value="%2$s">', $tag->name, wp_hash($answer, 'wpcf7_quiz'));
    return str_replace('<input', '<p class="wpcf7-quiz-label">' . esc_html($question) . '</p>' . $hidden_html . '<input', $html);
}