Conditional Fields for Contact Form 7 - Version 1.2.2

Version Description

  • Fix critical bug that was present in version 1.2 and 1.2.1
Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.2

cf7cf.php CHANGED
@@ -17,7 +17,7 @@ class ContactForm7ConditionalFields {
17
  add_action('load-toplevel_page_wpcf7', array(__CLASS__, 'tag_generator'));
18
 
19
  // compatibility with CF7 multi-step forms
20
- if (!function_exists('cf7msm_get')) add_filter( 'wpcf7_posted_data', array($this,'cf7msm_merge_post_with_cookie'), 8, 1 );
21
 
22
  add_filter( 'wpcf7_posted_data', array($this, 'remove_hidden_post_data') );
23
  add_filter( 'wpcf7_mail_components', array($this, 'hide_hidden_mail_fields') );
@@ -169,6 +169,8 @@ class ContactForm7ConditionalFields {
169
 
170
  function cf7msm_merge_post_with_cookie($posted_data) {
171
 
 
 
172
  if (!$posted_data) {
173
  $posted_data = WPCF7_Submission::get_instance()->get_posted_data();
174
  }
@@ -185,8 +187,8 @@ class ContactForm7ConditionalFields {
185
 
186
  // remove all the currently posted data from the cookie data (we don't wanna add it twice)
187
  $cookie_data_hidden_group_fields = array_diff($cookie_data_hidden_group_fields, array_keys($posted_data));
188
- $cookie_data_hidden_groups = array_diff($cookie_data_hidden_groups, $this->hidden_groups, $this->visible_groups);
189
- $cookie_data_visible_groups = array_diff($cookie_data_visible_groups, $this->hidden_groups, $this->visible_groups);
190
 
191
  // update current post data with cookie data
192
  $posted_data['_wpcf7cf_hidden_group_fields'] = addslashes(json_encode(array_merge((array) $cookie_data_hidden_group_fields, $this->hidden_fields)));
17
  add_action('load-toplevel_page_wpcf7', array(__CLASS__, 'tag_generator'));
18
 
19
  // compatibility with CF7 multi-step forms
20
+ add_filter( 'wpcf7_posted_data', array($this,'cf7msm_merge_post_with_cookie'), 8, 1 );
21
 
22
  add_filter( 'wpcf7_posted_data', array($this, 'remove_hidden_post_data') );
23
  add_filter( 'wpcf7_mail_components', array($this, 'hide_hidden_mail_fields') );
169
 
170
  function cf7msm_merge_post_with_cookie($posted_data) {
171
 
172
+ if (!function_exists('cf7msm_get')) return $posted_data;
173
+
174
  if (!$posted_data) {
175
  $posted_data = WPCF7_Submission::get_instance()->get_posted_data();
176
  }
187
 
188
  // remove all the currently posted data from the cookie data (we don't wanna add it twice)
189
  $cookie_data_hidden_group_fields = array_diff($cookie_data_hidden_group_fields, array_keys($posted_data));
190
+ $cookie_data_hidden_groups = array_diff((array) $cookie_data_hidden_groups, $this->hidden_groups, $this->visible_groups);
191
+ $cookie_data_visible_groups = array_diff((array) $cookie_data_visible_groups, $this->hidden_groups, $this->visible_groups);
192
 
193
  // update current post data with cookie data
194
  $posted_data['_wpcf7cf_hidden_group_fields'] = addslashes(json_encode(array_merge((array) $cookie_data_hidden_group_fields, $this->hidden_fields)));
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: 1.2.1
8
  Author URI: http://bdwm.be/
9
  */
10
 
@@ -24,7 +24,7 @@ Author URI: http://bdwm.be/
24
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.2.1' );
28
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
29
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
30
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
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.2.2
8
  Author URI: http://bdwm.be/
9
  */
10
 
24
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.2.2' );
28
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
29
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
30
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
readme.txt CHANGED
@@ -6,7 +6,7 @@ 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.2
9
- Stable tag: 1.2.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -83,6 +83,9 @@ I will assume that you successfully installed both plugins, that you were able t
83
 
84
  == Changelog ==
85
 
 
 
 
86
  = 1.2.1 =
87
  * Improve compatibility with <a href="https://wordpress.org/plugins/contact-form-7-signature-addon/">Contact Form 7 Signature Addon</a>: now allowing multiple hidden signature fields.
88
 
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
  Tested up to: 4.7.2
9
+ Stable tag: 1.2.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
83
 
84
  == Changelog ==
85
 
86
+ = 1.2.2 =
87
+ * Fix critical bug that was present in version 1.2 and 1.2.1
88
+
89
  = 1.2.1 =
90
  * Improve compatibility with <a href="https://wordpress.org/plugins/contact-form-7-signature-addon/">Contact Form 7 Signature Addon</a>: now allowing multiple hidden signature fields.
91