PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.3
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 6.3, at classes/models/fields/FrmFieldDefault.php

65 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 /**
7 * @since 3.0
8 */
9 class FrmFieldDefault extends FrmFieldType {
10
11 /**
12 * @var bool
13 * @since 3.0
14 */
15 protected $holds_email_values = true;
16
17 /**
18 * @param $type string
19 *
20 * @return void
21 */
22 protected function set_type( $type ) {
23 if ( empty( $type ) ) {
24 $type = 'text';
25 }
26 parent::set_type( $type );
27 }
28
29 /**
30 * @return void
31 */
32 public function show_on_form_builder( $name = '' ) {
33 $field = FrmFieldsHelper::setup_edit_vars( $this->field );
34
35 ob_start();
36 do_action( 'frm_display_added_fields', $field );
37 do_action( 'frm_display_added_' . $this->type . '_field', $field );
38 $input_html = ob_get_contents();
39 ob_end_clean();
40
41 if ( empty( $input_html ) ) {
42 echo $this->builder_text_field( $name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
43 } else {
44 echo $input_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
45 }
46 }
47
48 /**
49 * @return false|string
50 */
51 public function front_field_input( $args, $shortcode_atts ) {
52 $pass_args = array(
53 'errors' => $args['errors'],
54 'html_id' => $args['html_id'],
55 );
56 ob_start();
57 do_action( 'frm_form_fields', $this->field, $args['field_name'], $pass_args );
58 do_action( 'frm_form_field_' . $this->type, $this->field, $args['field_name'], $pass_args );
59 $input_html = ob_get_contents();
60 ob_end_clean();
61
62 return $input_html;
63 }
64 }
65