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

Version Description

  • Fixed: Checkbox field validation issue when field is not required.
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.5.3.1

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 1.5.3 =
4
  - Added: AJAX form submissions.
5
  - Added: Full support and compatiblity with Google AMP.
1
  == Changelog ==
2
 
3
+ = 1.5.3.1 =
4
+ - Fixed: Checkbox field validation issue when field is not required.
5
+
6
  = 1.5.3 =
7
  - Added: AJAX form submissions.
8
  - Added: Full support and compatiblity with Google AMP.
includes/fields/class-checkbox.php CHANGED
@@ -594,7 +594,10 @@ class WPForms_Field_Checkbox extends WPForms_Field {
594
  }
595
 
596
  // Basic required check - If field is marked as required, check for entry data.
597
- if ( ! empty( $form_data['fields'][ $field_id ]['required'] ) && ( empty( $field_submit ) ) || ( 1 === count( $field_submit ) && empty( $field_submit[0] ) ) ) {
 
 
 
598
  $error = wpforms_get_required_label();
599
  }
600
 
@@ -682,7 +685,7 @@ class WPForms_Field_Checkbox extends WPForms_Field {
682
 
683
  foreach ( $field_submit as $item ) {
684
  foreach ( $field['choices'] as $key => $choice ) {
685
- if ( $item == $choice['value'] ) {
686
  $value[] = $choice['label'];
687
  $choice_keys[] = $key;
688
  break;
594
  }
595
 
596
  // Basic required check - If field is marked as required, check for entry data.
597
+ if (
598
+ ! empty( $form_data['fields'][ $field_id ]['required'] ) &&
599
+ ( empty( $field_submit ) || ( 1 === count( $field_submit ) && empty( $field_submit[0] ) ) )
600
+ ) {
601
  $error = wpforms_get_required_label();
602
  }
603
 
685
 
686
  foreach ( $field_submit as $item ) {
687
  foreach ( $field['choices'] as $key => $choice ) {
688
+ if ( $item === $choice['value'] || ( empty( $choice['value'] ) && (int) str_replace( 'Choice ', '', $item ) === $key ) ) {
689
  $value[] = $choice['label'];
690
  $choice_keys[] = $key;
691
  break;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpforms, jaredatch, smub, slaFFik
3
  Tags: contact form, contact form plugin, forms, form builder, custom form, contact button, contact me, custom contact form, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form, feedback
4
  Requires at least: 4.8
5
  Tested up to: 5.2
6
- Stable tag: 1.5.3
7
  Requires PHP: 5.3.3
8
  License: GNU General Public License v2.0 or later
9
 
@@ -408,6 +408,9 @@ Syed Balkhi
408
 
409
  == Changelog ==
410
 
 
 
 
411
  = 1.5.3 =
412
  - Added: AJAX form submissions.
413
  - Added: Full support and compatiblity with Google AMP.
3
  Tags: contact form, contact form plugin, forms, form builder, custom form, contact button, contact me, custom contact form, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form, feedback
4
  Requires at least: 4.8
5
  Tested up to: 5.2
6
+ Stable tag: 1.5.3.1
7
  Requires PHP: 5.3.3
8
  License: GNU General Public License v2.0 or later
9
 
408
 
409
  == Changelog ==
410
 
411
+ = 1.5.3.1 =
412
+ - Fixed: Checkbox field validation issue when field is not required.
413
+
414
  = 1.5.3 =
415
  - Added: AJAX form submissions.
416
  - Added: Full support and compatiblity with Google AMP.
wpforms.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
- * Version: 1.5.3
9
  * Text Domain: wpforms-lite
10
  * Domain Path: languages
11
  *
@@ -36,7 +36,7 @@ if ( ! defined( 'ABSPATH' ) ) {
36
 
37
  // Plugin version.
38
  if ( ! defined( 'WPFORMS_VERSION' ) ) {
39
- define( 'WPFORMS_VERSION', '1.5.3' );
40
  }
41
 
42
  // Plugin Folder Path.
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
+ * Version: 1.5.3.1
9
  * Text Domain: wpforms-lite
10
  * Domain Path: languages
11
  *
36
 
37
  // Plugin version.
38
  if ( ! defined( 'WPFORMS_VERSION' ) ) {
39
+ define( 'WPFORMS_VERSION', '1.5.3.1' );
40
  }
41
 
42
  // Plugin Folder Path.