Contact Form by WPForms – Drag & Drop Form Builder for WordPress - Version 1.2.3.2

Version Description

  • Fixed: Default field validation considered 0 as empty
Download this release

Release Info

Developer jaredatch
Plugin Icon 128x128 Contact Form by WPForms – Drag & Drop Form Builder for WordPress
Version 1.2.3.2
Comparing to
See all releases

Code changes from version 1.2.3.1 to 1.2.3.2

includes/fields/class-base.php CHANGED
@@ -566,7 +566,7 @@ abstract class WPForms_Field {
566
  public function validate( $field_id, $field_submit, $form_data ) {
567
 
568
  // Basic required check - If field is marked as required, check for entry data
569
- if ( !empty( $form_data['fields'][$field_id]['required'] ) && empty( $field_submit ) ) {
570
 
571
  wpforms()->process->errors[$form_data['id']][$field_id] = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
572
  }
566
  public function validate( $field_id, $field_submit, $form_data ) {
567
 
568
  // Basic required check - If field is marked as required, check for entry data
569
+ if ( !empty( $form_data['fields'][$field_id]['required'] ) && empty( $field_submit ) && '0' != $field_submit ) {
570
 
571
  wpforms()->process->errors[$form_data['id']][$field_id] = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
572
  }
lite/wpforms-lite.php CHANGED
@@ -10,7 +10,7 @@ class WPForms_Lite {
10
  /**
11
  * Primary class constructor.
12
  *
13
- * @since 1.2.x
14
  */
15
  public function __construct() {
16
 
@@ -24,124 +24,6 @@ class WPForms_Lite {
24
  add_action( 'wpforms_admin_page', array( $this, 'entries_page' ) );
25
  add_action( 'admin_enqueue_scripts', array( $this, 'addon_page_enqueues' ) );
26
  add_action( 'wpforms_admin_page', array( $this, 'addons_page' ) );
27
- // Giveaway - 1.2.3.1
28
- add_action( 'admin_notices', array( $this, 'giveaway_notice' ) );
29
- add_action( 'admin_init', array( $this, 'giveaway_notice_dismiss' ) );
30
- add_action( 'admin_menu', array( $this, 'giveaway_menu' ) );
31
- }
32
-
33
- /**
34
- * Giveaway admin notice.
35
- *
36
- * @since 1.2.3.1
37
- */
38
- public function giveaway_notice() {
39
-
40
- // Only display for admins
41
- if ( ! current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) )
42
- return;
43
-
44
- // Don't display if has been dismissed or user has been to giveaway page
45
- if ( get_option( 'wpforms_giveaway_07072016', false ) )
46
- return;
47
-
48
- $dismiss = esc_url( add_query_arg( array( 'wpforms_giveaway_dismiss' => true ) ) );
49
- $giveaway = admin_url( 'admin.php?page=wpforms-giveaway' );
50
- ?>
51
- <div class="notice wpforms-giveaway-notice">
52
- <span class="dashicons dashicons-thumbs-up"></span>
53
- Are you enjoying <strong>WPForms Lite</strong>? We are giving away 10 free licenses of WPForms Pro - <a href="<?php echo $giveaway; ?>">Enter the Giveaway Here</a> (It’s easy)
54
- <a href="<?php echo $dismiss; ?>" class="wpforms-giveaway-dismiss"><span class="dashicons dashicons-dismiss"></span></a>
55
- </div>
56
- <style type="text/css">
57
- .wpforms-giveaway-notice {
58
- position: relative; padding: 8px 10px 8px 40px; border-left: 0;
59
- }
60
- .wpforms-giveaway-notice span.dashicons-thumbs-up {
61
- color: white; background: #0e6cad; position: absolute; left: 0; height: 100%; top: 0; padding: 0 5px;
62
- }
63
- .wpforms-giveaway-notice span.dashicons-thumbs-up:before {
64
- margin-top: 6px; display: inline-block;
65
- }
66
- .wpforms-giveaway-dismiss {
67
- float: right; color: #999; text-decoration: none;
68
- }
69
- </style>
70
- <?php
71
- }
72
-
73
- /**
74
- * Giveaway admin notice dismiss.
75
- *
76
- * @since 1.2.3.1
77
- */
78
- public function giveaway_notice_dismiss() {
79
-
80
- if ( !current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) )
81
- return;
82
-
83
- if ( isset( $_GET[ 'wpforms_giveaway_dismiss' ] ) || ( isset( $_GET['page'] ) && 'wpforms-giveaway' == $_GET['page'] ) ) {
84
- update_option( 'wpforms_giveaway_07072016', 'hide' );
85
- }
86
- }
87
-
88
- /**
89
- * Giveaway menu item for settings page.
90
- *
91
- * @since 1.2.3.1
92
- */
93
- public function giveaway_menu() {
94
-
95
- add_submenu_page(
96
- 'wpforms-settings',
97
- __( 'WPForms Giveaway', 'wpforms' ),
98
- __( 'WPForms Giveaway', 'wpforms' ),
99
- apply_filters( 'wpforms_manage_cap', 'manage_options' ),
100
- 'wpforms-giveaway',
101
- array( $this, 'giveaway_page' )
102
- );
103
- }
104
-
105
- /**
106
- * Giveaway settings page.
107
- *
108
- * @since 1.2.3.1
109
- */
110
- public function giveaway_page() {
111
-
112
- // Set option once user goes to this page so they don't see the admin
113
- // notice again when using the WP dashboard
114
- update_option( 'wpforms_giveaway_07072016', 'hide' );
115
- ?>
116
- <div id="wpforms-giveaway" class="wrap">
117
- <img src="<?php echo WPFORMS_PLUGIN_URL; ?>assets/images/sullie.png" alt="Sullie WPForms mascot" class="sullie">
118
- <h1>WPForms PRO Giveaway</h1>
119
- <p>Thank you for using WPForms Lite. This week, we're giving away 10 Pro accounts of WPForms ($199 value each).</p>
120
- <p>** Winners will be announced on Wednesday, July 6th **</p>
121
- <p>Enter the giveaway below:</p>
122
- <a class="rcptr" href="http://www.rafflecopter.com/rafl/display/2ec3ed916/" rel="nofollow" data-raflid="2ec3ed916" data-theme="classic" data-template="" id="rcwidget_oaxpe87z">a Rafflecopter giveaway</a>
123
- <script src="https://widget-prime.rafflecopter.com/launch.js"></script>
124
- </div>
125
- <style type="text/css">
126
- #wpforms-giveaway {
127
- max-width: 800px;
128
- }
129
- #wpforms-giveaway .sullie {
130
- float:right;
131
- max-width:180px;
132
- margin:20px 0 0 30px;
133
- }
134
- #wpforms-giveaway h1 {
135
- font-size: 30px;
136
- margin: 0 0 26px 0;
137
- }
138
- #wpforms-giveaway p {
139
- font-size: 18px;
140
- margin: 0 0 24px 0;
141
- max-width: 540px;
142
- }
143
- </style>
144
- <?php
145
  }
146
 
147
  /**
10
  /**
11
  * Primary class constructor.
12
  *
13
+ * @since 1.2.0
14
  */
15
  public function __construct() {
16
 
24
  add_action( 'wpforms_admin_page', array( $this, 'entries_page' ) );
25
  add_action( 'admin_enqueue_scripts', array( $this, 'addon_page_enqueues' ) );
26
  add_action( 'wpforms_admin_page', array( $this, 'addons_page' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  /**
readme.txt CHANGED
@@ -160,6 +160,9 @@ Syed Balkhi
160
 
161
  == Changelog ==
162
 
 
 
 
163
  = 1.2.3.1 =
164
  - Fixed: Blank form email notification defaults
165
 
160
 
161
  == Changelog ==
162
 
163
+ = 1.2.3.2 =
164
+ - Fixed: Default field validation considered 0 as empty
165
+
166
  = 1.2.3.1 =
167
  - Fixed: Blank form email notification defaults
168