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

69 lines 1.5 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 *
14 * @since 3.0
15 */
16 protected $holds_email_values = true;
17
18 /**
19 * @param string $type
20 *
21 * @return void
22 */
23 protected function set_type( $type ) {
24 if ( ! $type ) {
25 $type = 'text';
26 }
27 parent::set_type( $type );
28 }
29
30 /**
31 * @param string $name
32 *
33 * @return void
34 */
35 public function show_on_form_builder( $name = '' ) {
36 $field = FrmFieldsHelper::setup_edit_vars( $this->field );
37
38 ob_start();
39 do_action( 'frm_display_added_fields', $field );
40 do_action( 'frm_display_added_' . $this->type . '_field', $field );
41 $input_html = ob_get_clean();
42
43 if ( $input_html ) {
44 echo $input_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
45 } else {
46 echo $this->builder_text_field( $name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
47 }
48 }
49
50 /**
51 * @param array $args
52 * @param array $shortcode_atts
53 *
54 * @return string
55 */
56 public function front_field_input( $args, $shortcode_atts ) {
57 $pass_args = array(
58 'errors' => $args['errors'],
59 'html_id' => $args['html_id'],
60 );
61 ob_start();
62 do_action( 'frm_form_fields', $this->field, $args['field_name'], $pass_args );
63 do_action( 'frm_form_field_' . $this->type, $this->field, $args['field_name'], $pass_args );
64 $input_html = ob_get_clean();
65
66 return is_string( $input_html ) ? $input_html : '';
67 }
68 }
69