PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.3.9
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.3.9
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / fields / class-field-hidden.php

class-field-hidden.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.3.9, at includes/fields/class-field-hidden.php

85 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Text Field Class
5 */
6 class WeForms_Form_Field_Hidden extends WeForms_Field_Contract {
7
8 function __construct() {
9 $this->name = __( 'Hidden Field', 'weforms' );
10 $this->input_type = 'custom_hidden_field';
11 $this->icon = 'eye-slash';
12 }
13
14 /**
15 * Render the text field
16 *
17 * @param array $field_settings
18 * @param integer $form_id
19 *
20 * @return void
21 */
22 public function render( $field_settings, $form_id ) {
23 $value = isset($_GET[$field_settings['dynamic']['param_name']]) ? $_GET[$field_settings['dynamic']['param_name']] : $field_settings['meta_value'];
24 ?>
25 <input type="hidden" name="<?php echo esc_attr( $field_settings['name'] ); ?>" value="<?php echo esc_attr( $value ); ?>">
26 <?php
27 }
28
29 /**
30 * Get field options setting
31 *
32 * @return array
33 */
34 public function get_options_settings() {
35 $settings = array(
36 array(
37 'name' => 'name',
38 'title' => __( 'Meta Key', 'weforms' ),
39 'type' => 'text',
40 'section' => 'basic',
41 'priority' => 10,
42 'help_text' => __( 'Name of the meta key this field will save to', 'weforms' ),
43 ),
44
45 array(
46 'name' => 'meta_value',
47 'title' => __( 'Meta Value', 'weforms' ),
48 'type' => 'text',
49 'section' => 'basic',
50 'priority' => 11,
51 'help_text' => __( 'Enter the meta value', 'weforms' ),
52 ),
53
54 array(
55 'name' => 'dynamic',
56 'title' => '',
57 'type' => 'dynamic-field',
58 'section' => 'advanced',
59 'priority' => 23,
60 'help_text' => __( 'Check this option to allow field to be populated dynamically using hooks/query string/shortcode', 'weforms' ),
61 ),
62 );
63
64 return $settings;
65 }
66
67 /**
68 * Get the field props
69 *
70 * @return array
71 */
72 public function get_field_props() {
73 $props = array(
74 'template' => $this->get_type(),
75 'name' => '',
76 'meta_value' => '',
77 'is_meta' => 'yes',
78 'id' => 0,
79 'is_new' => true,
80 'wpuf_cond' => null
81 );
82
83 return $props;
84 }
85 }