Conditional Fields for Contact Form 7 - Version 1.0

Version Description

  • I feel that at this point the plugin is stable enough in most cases, so it's about time to take it out of beta :)
  • Update JS en CSS version numbers
  • Fix PHP warning with forms that are not using conditional fields (https://wordpress.org/support/topic/conditional-formatting-error/)
  • Tested on WP 4.7.1
Download this release

Release Info

Developer Jules Colle
Plugin Icon 128x128 Conditional Fields for Contact Form 7
Version 1.0
Comparing to
See all releases

Code changes from version 0.2.9 to 1.0

contact-form-7-conditional-fields.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Contact Form 7 Conditional Fields
4
  Plugin URI: http://bdwm.be/
5
  Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  Author: Jules Colle
7
- Version: 0.2.9
8
  Author URI: http://bdwm.be/
9
  */
10
 
@@ -26,7 +26,7 @@ Author URI: http://bdwm.be/
26
  ?>
27
  <?php
28
 
29
- define( 'WPCF7CF_VERSION', '0.2.5' );
30
  define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
31
  define( 'WPCF7CF_PLUGIN', __FILE__ );
32
  define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
@@ -223,6 +223,7 @@ class ContactForm7ConditionalFields {
223
  }
224
 
225
  $hidden_fields = json_decode(stripslashes($posted_data['_wpcf7cf_hidden_group_fields']));
 
226
  foreach ($hidden_fields as $field) {
227
  $this->hidden_fields[] = $field;
228
  if (wpcf7cf_endswith($field, '[]')) {
4
  Plugin URI: http://bdwm.be/
5
  Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  Author: Jules Colle
7
+ Version: 1.0
8
  Author URI: http://bdwm.be/
9
  */
10
 
26
  ?>
27
  <?php
28
 
29
+ define( 'WPCF7CF_VERSION', '1.0' );
30
  define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
31
  define( 'WPCF7CF_PLUGIN', __FILE__ );
32
  define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
223
  }
224
 
225
  $hidden_fields = json_decode(stripslashes($posted_data['_wpcf7cf_hidden_group_fields']));
226
+ if (!is_array($hidden_fields) || count($hidden_fields) == 0) return;
227
  foreach ($hidden_fields as $field) {
228
  $this->hidden_fields[] = $field;
229
  if (wpcf7cf_endswith($field, '[]')) {
js/scripts.js CHANGED
@@ -38,8 +38,6 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
38
 
39
  if ($field.length == 1) {
40
 
41
-
42
-
43
  // single field (tested with text field, single checkbox, select with single value (dropdown), select with multiple values)
44
 
45
  if ($field.is('select')) {
38
 
39
  if ($field.length == 1) {
40
 
 
 
41
  // single field (tested with text field, single checkbox, select with single value (dropdown), select with multiple values)
42
 
43
  if ($field.is('select')) {
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: Jules Colle
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
- Tested up to: 4.7
9
- Stable tag: 0.2.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -47,6 +47,12 @@ Because no questions have been asked frequently about this plugin.
47
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
50
  = 0.2.9 =
51
  * Re-added wpcf7_add_shortcode() function if wpcf7_add_form_tag() is not found, because some people claimed to get a "function not found" error for the wpcf7_add_form_tag function with the latest version of CF7 installed. (https://wordpress.org/support/topic/activation-issue-5/ and https://wordpress.org/support/topic/http-500-unable-to-handle-request-error-after-update/)
52
  * Fixed some PHP notices (https://wordpress.org/support/topic/undefined-index-error-in-ajax-response/)
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
+ Tested up to: 4.7.1
9
+ Stable tag: 1.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
47
 
48
  == Changelog ==
49
 
50
+ = 1.0 =
51
+ * I feel that at this point the plugin is stable enough in most cases, so it's about time to take it out of beta :)
52
+ * Update JS en CSS version numbers
53
+ * Fix PHP warning with forms that are not using conditional fields (https://wordpress.org/support/topic/conditional-formatting-error/)
54
+ * Tested on WP 4.7.1
55
+
56
  = 0.2.9 =
57
  * Re-added wpcf7_add_shortcode() function if wpcf7_add_form_tag() is not found, because some people claimed to get a "function not found" error for the wpcf7_add_form_tag function with the latest version of CF7 installed. (https://wordpress.org/support/topic/activation-issue-5/ and https://wordpress.org/support/topic/http-500-unable-to-handle-request-error-after-update/)
58
  * Fixed some PHP notices (https://wordpress.org/support/topic/undefined-index-error-in-ajax-response/)