Conditional Fields for Contact Form 7 - Version 1.7.6

Version Description

(11-01-19) = * Fixed small compatibility problem with CF7 Smart Grid (https://wordpress.org/support/topic/problem-on-save-form-when-the-active-tabs-are-not-conditional-form/#post-12085173) * Fixed some more porblems with parsing conditions (regex changes) * Got rid of screen_icon notice on CF settings page

Download this release

Release Info

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

Code changes from version 1.7.5 to 1.7.6

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.7.5
8
  Author URI: http://bdwm.be/
9
  */
10
 
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.7.6
8
  Author URI: http://bdwm.be/
9
  */
10
 
init.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.7.5' );
4
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
5
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
6
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
@@ -11,7 +11,7 @@ if (!defined('WPCF7CF_LOAD_JS')) define('WPCF7CF_LOAD_JS', true);
11
  if (!defined('WPCF7CF_LOAD_CSS')) define('WPCF7CF_LOAD_CSS', true);
12
 
13
  if (!defined('WPCF7CF_REGEX_MAIL_GROUP')) define( 'WPCF7CF_REGEX_MAIL_GROUP', '@\[[\s]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\s]*\](.*?)\[[\s]*/[\s]*\1[\s]*\]@s');
14
- if (!defined('WPCF7CF_REGEX_CONDITIONS')) define( 'WPCF7CF_REGEX_CONDITIONS', '/(?:show \[([^\]]*?)\]|and) if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"([^\"]*?)\")?)/ms');
15
 
16
 
17
  if(file_exists(WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php')) {
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.7.6' );
4
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
5
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
6
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
11
  if (!defined('WPCF7CF_LOAD_CSS')) define('WPCF7CF_LOAD_CSS', true);
12
 
13
  if (!defined('WPCF7CF_REGEX_MAIL_GROUP')) define( 'WPCF7CF_REGEX_MAIL_GROUP', '@\[[\s]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\s]*\](.*?)\[[\s]*/[\s]*\1[\s]*\]@s');
14
+ if (!defined('WPCF7CF_REGEX_CONDITIONS')) define( 'WPCF7CF_REGEX_CONDITIONS', '/(?:show \[([^\]]*?)\]|and) if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"(.*)\")?)/m');
15
 
16
 
17
  if(file_exists(WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php')) {
js/scripts_admin.js CHANGED
@@ -8,8 +8,8 @@ if ($wpcf7cf_new_entry.length > 0) {
8
  var wpcf7cf_new_and_rule_html = $wpcf7cf_new_entry.find('.wpcf7cf-and-rule')[0].outerHTML;
9
  var wpcf7cf_new_entry_html = $wpcf7cf_new_entry.html();
10
 
11
- var cf_rule_regex = /(?:show \[([^\]]*?)\]) if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"([^\"]*?)\")?)/g;
12
- var cf_rule_regex_and = /and if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"([^\"]*?)\")?)/g;
13
 
14
 
15
  if (_wpcf7 == null) { var _wpcf7 = wpcf7}; // wpcf7 4.8 fix
@@ -161,7 +161,7 @@ if ($wpcf7cf_new_entry.length > 0) {
161
 
162
  }
163
 
164
- $('#wpcf7-admin-form-element').on('submit.wpcf7cf', function() {
165
  update_settings_textarea();
166
  return true;
167
  });
8
  var wpcf7cf_new_and_rule_html = $wpcf7cf_new_entry.find('.wpcf7cf-and-rule')[0].outerHTML;
9
  var wpcf7cf_new_entry_html = $wpcf7cf_new_entry.html();
10
 
11
+ var cf_rule_regex = /(?:show \[([^\]]*?)\]) if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"(.*)\")?)/g;
12
+ var cf_rule_regex_and = /and if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty)(?: \"(.*)\")?)/g;
13
 
14
 
15
  if (_wpcf7 == null) { var _wpcf7 = wpcf7}; // wpcf7 4.8 fix
161
 
162
  }
163
 
164
+ $('#wpcf7-admin-form-element, #post').on('submit.wpcf7cf', function() {
165
  update_settings_textarea();
166
  return true;
167
  });
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: 5.3
9
- Stable tag: 1.7.5
10
  Requires PHP: 5.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -102,6 +102,11 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
105
  = 1.7.5 (10-31-19) =
106
  * Fixed bug in admin where settings got cleared if using some operators (mostly PRO operators)
107
 
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
  Tested up to: 5.3
9
+ Stable tag: 1.7.6
10
  Requires PHP: 5.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
102
 
103
  == Changelog ==
104
 
105
+ = 1.7.6 (11-01-19) =
106
+ * Fixed small compatibility problem with CF7 Smart Grid (https://wordpress.org/support/topic/problem-on-save-form-when-the-active-tabs-are-not-conditional-form/#post-12085173)
107
+ * Fixed some more porblems with parsing conditions (regex changes)
108
+ * Got rid of screen_icon notice on CF settings page
109
+
110
  = 1.7.5 (10-31-19) =
111
  * Fixed bug in admin where settings got cleared if using some operators (mostly PRO operators)
112
 
wpcf7cf-options.php CHANGED
@@ -66,7 +66,6 @@ function wpcf7cf_options_page() {
66
  ?>
67
 
68
  <div class="wrap wpcf7cf-admin-wrap">
69
- <?php screen_icon(); ?>
70
  <h2>Contact Form 7 - Conditional Fields Settings</h2>
71
  <?php if (!$wpcf7cf_options['notice_dismissed']) { ?>
72
  <div class="wpcf7cf-options-notice notice notice-warning is-dismissible"><div style="padding: 10px 0;"><strong>Notice</strong>: These are global settings for Contact Form 7 - Conditional Fields. <br><br><strong>How to create/edit conditional fields?</strong>
66
  ?>
67
 
68
  <div class="wrap wpcf7cf-admin-wrap">
 
69
  <h2>Contact Form 7 - Conditional Fields Settings</h2>
70
  <?php if (!$wpcf7cf_options['notice_dismissed']) { ?>
71
  <div class="wpcf7cf-options-notice notice notice-warning is-dismissible"><div style="padding: 10px 0;"><strong>Notice</strong>: These are global settings for Contact Form 7 - Conditional Fields. <br><br><strong>How to create/edit conditional fields?</strong>