PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.02.04
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.02.04
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / fields / FrmFieldDefault.php

FrmFieldDefault.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 4.02.04, at classes/models/fields/FrmFieldDefault.php

54 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @since 3.0
5 */
6 class FrmFieldDefault extends FrmFieldType {
7
8 /**
9 * @var bool
10 * @since 3.0
11 */
12 protected $holds_email_values = true;
13
14 /**
15 * @param $type string
16 */
17 protected function set_type( $type ) {
18 if ( empty( $type ) ) {
19 $type = 'text';
20 }
21 parent::set_type( $type );
22 }
23
24 public function show_on_form_builder( $name = '' ) {
25 $field = FrmFieldsHelper::setup_edit_vars( $this->field );
26
27 ob_start();
28 do_action( 'frm_display_added_fields', $field );
29 do_action( 'frm_display_added_' . $this->type . '_field', $field );
30 $input_html = ob_get_contents();
31 ob_end_clean();
32
33 if ( empty( $input_html ) ) {
34 echo $this->builder_text_field( $name ); // WPCS: XSS ok.
35 } else {
36 echo $input_html; // WPCS: XSS ok.
37 }
38 }
39
40 public function front_field_input( $args, $shortcode_atts ) {
41 $pass_args = array(
42 'errors' => $args['errors'],
43 'html_id' => $args['html_id'],
44 );
45 ob_start();
46 do_action( 'frm_form_fields', $this->field, $args['field_name'], $pass_args );
47 do_action( 'frm_form_field_' . $this->type, $this->field, $args['field_name'], $pass_args );
48 $input_html = ob_get_contents();
49 ob_end_clean();
50
51 return $input_html;
52 }
53 }
54