Conditional Fields for Contact Form 7 - Version 1.6.2

Version Description

(06-15-19) = * Small changes to tag generator buttons * Multistep bug fix. All group conditions are evaluated a second time after the page has fully loaded. * PRO: added new operator 'function', allowing you to write custom javascript functions to determine whether or not a group should be shown https://conditional-fields-cf7.bdwm.be/advanced-conditional-logic-with-custom-javascript-functions/ * PRO: fix bug with < (less than) operator

Download this release

Release Info

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

Code changes from version 1.6.1 to 1.6.2

admin.php CHANGED
@@ -165,7 +165,7 @@ function wpcf7cf_sanitize_options($options) {
165
  foreach ($option_entry['and_rules'] as $and_rule) {
166
  $sanitized_option['and_rules'][] = [
167
  'if_field' => sanitize_text_field($and_rule['if_field']),
168
- 'operator' => sanitize_text_field($and_rule['operator']),
169
  'if_value' => sanitize_text_field($and_rule['if_value']),
170
  ];
171
  }
165
  foreach ($option_entry['and_rules'] as $and_rule) {
166
  $sanitized_option['and_rules'][] = [
167
  'if_field' => sanitize_text_field($and_rule['if_field']),
168
+ 'operator' => $and_rule['operator'],
169
  'if_value' => sanitize_text_field($and_rule['if_value']),
170
  ];
171
  }
cf7cf.php CHANGED
@@ -20,8 +20,7 @@ class ContactForm7ConditionalFields {
20
  add_action('wpcf7_init', array(__CLASS__, 'add_shortcodes'));
21
 
22
  // Tag generator
23
- add_action('load-contact_page_wpcf7-new', array(__CLASS__, 'tag_generator'));
24
- add_action('load-toplevel_page_wpcf7', array(__CLASS__, 'tag_generator'));
25
 
26
  // compatibility with CF7 multi-step forms by Webhead LLC.
27
  add_filter( 'wpcf7_posted_data', array($this,'cf7msm_merge_post_with_cookie'), 8, 1 );
@@ -123,7 +122,7 @@ class ContactForm7ConditionalFields {
123
  return;
124
 
125
  wpcf7_add_tag_generator('group',
126
- __('Conditional fields Group', 'wpcf7cf'),
127
  'wpcf7-tg-pane-group',
128
  array(__CLASS__, 'tg_pane')
129
  );
@@ -388,6 +387,12 @@ function wpcf7cf_do_enqueue_scripts() {
388
  function wpcf7cf_enqueue_scripts() {
389
  if (is_admin()) return;
390
  wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
 
 
 
 
 
 
391
  }
392
 
393
  function wpcf7cf_enqueue_styles() {
20
  add_action('wpcf7_init', array(__CLASS__, 'add_shortcodes'));
21
 
22
  // Tag generator
23
+ add_action('admin_init', array(__CLASS__, 'tag_generator'), 590);
 
24
 
25
  // compatibility with CF7 multi-step forms by Webhead LLC.
26
  add_filter( 'wpcf7_posted_data', array($this,'cf7msm_merge_post_with_cookie'), 8, 1 );
122
  return;
123
 
124
  wpcf7_add_tag_generator('group',
125
+ __('Conditional Fields Group', 'wpcf7cf'),
126
  'wpcf7-tg-pane-group',
127
  array(__CLASS__, 'tg_pane')
128
  );
387
  function wpcf7cf_enqueue_scripts() {
388
  if (is_admin()) return;
389
  wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
390
+ wp_localize_script('wpcf7cf-scripts', 'wpcf7cf_global_settings',
391
+ array(
392
+ 'ajaxurl' => admin_url('admin-ajax.php'),
393
+ )
394
+ );
395
+
396
  }
397
 
398
  function wpcf7cf_enqueue_styles() {
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.6.1
8
  Author URI: http://bdwm.be/
9
  */
10
 
@@ -32,7 +32,7 @@ if ( function_exists( 'wpcf7cf_pro_deactivate_free_version_notice' ) ) {
32
  function wpcf7cf_pro_deactivate_free_version_notice() {
33
  ?>
34
  <div class="notice notice-error is-dismissible">
35
- <p><?php echo sprintf( __( '<strong>Contact Form 7 Conditional Fields PRO</strong> needs to %sdeactivate the free plugin%s', 'wpcf7cf' ), '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=cf7-conditional-fields%2Fcontact-form-7-conditional-fields.php&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_cf7-conditional-fields/contact-form-7-conditional-fields.php' ) . '">', '</a>' ); ?></p>
36
  </div>
37
  <?php
38
  }
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.6.2
8
  Author URI: http://bdwm.be/
9
  */
10
 
32
  function wpcf7cf_pro_deactivate_free_version_notice() {
33
  ?>
34
  <div class="notice notice-error is-dismissible">
35
+ <p><?php echo sprintf( __( '<strong>Contact Form 7 - Conditional Fields PRO</strong> needs to %sdeactivate the free plugin%s', 'wpcf7cf' ), '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=cf7-conditional-fields%2Fcontact-form-7-conditional-fields.php&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_cf7-conditional-fields/contact-form-7-conditional-fields.php' ) . '">', '</a>' ); ?></p>
36
  </div>
37
  <?php
38
  }
init.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.6.1' );
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 ) );
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.6.2' );
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 ) );
js/scripts.js CHANGED
@@ -3,9 +3,12 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
3
  var wpcf7cf_timeout;
4
 
5
  var wpcf7cf_show_animation = { "height": "show", "marginTop": "show", "marginBottom": "show", "paddingTop": "show", "paddingBottom": "show" };
6
- var wpcf7cf_hide_animation = { "height": "hide", "marginTop": "hide", "marginBottom": "hide", "paddingTop": "hide", "paddingBottom": "hide" };
7
 
8
- var wpcf7cf_change_events = 'input.wpcf7cf paste.wpcf7cf change.wpcf7cf click.wpcf7cf';
 
 
 
9
 
10
  var wpcf7cf_forms = [];
11
 
@@ -33,7 +36,7 @@ function Wpcf7cfForm($form) {
33
 
34
  form.$groups = [];
35
  form.repeaters = [];
36
- form.steps = []; // comming soon (i hope)
37
  form.fields = [];
38
 
39
  form.settings.animation_intime = parseInt(form.settings.animation_intime);
@@ -132,7 +135,7 @@ Wpcf7cfForm.prototype.displayFields = function() {
132
  });
133
 
134
  form.updateHiddenFields();
135
- }
136
  Wpcf7cfForm.prototype.updateHiddenFields = function() {
137
 
138
  var form = this;
@@ -162,7 +165,7 @@ Wpcf7cfForm.prototype.updateHiddenFields = function() {
162
  form.$visible_groups.val(JSON.stringify(visible_groups));
163
 
164
  return true;
165
- }
166
  Wpcf7cfForm.prototype.updateGroups = function() {
167
  var form = this;
168
  form.$groups = form.$form.find('[data-class="wpcf7cf_group"]');
@@ -189,8 +192,7 @@ Wpcf7cfForm.prototype.updateGroups = function() {
189
  });
190
  });
191
 
192
- }
193
-
194
  Wpcf7cfForm.prototype.updateEventListeners = function() {
195
 
196
  var form = this;
@@ -205,12 +207,10 @@ Wpcf7cfForm.prototype.updateEventListeners = function() {
205
  });
206
 
207
  //removed pro functions
208
- }
209
-
210
 
211
  //removed pro functions
212
 
213
-
214
  var wpcf7cf = {
215
 
216
  // keep this for backwards compatibility
@@ -230,19 +230,21 @@ var wpcf7cf = {
230
 
231
  var condition_and_rule = condition.and_rules[and_rule_i];
232
 
233
- var regex_patt = new RegExp(condition_and_rule.if_value, 'i');
234
 
235
- $field = jQuery('[name="' + condition_and_rule.if_field + '"], [name="' + condition_and_rule.if_field + '[]"], [data-original-name="' + condition_and_rule.if_field + '"], [data-original-name="' + condition_and_rule.if_field + '[]"]',$current_form); //, [data-original-name="' + condition_and_rule.if_field + '"]
 
 
 
236
 
237
- //TODO: ignore everything outside the sub_repeater if field is inside sub_repeater
238
 
239
- if ($field.length == 1) {
240
 
241
  // single field (tested with text field, single checkbox, select with single value (dropdown), select with multiple values)
242
 
243
  if ($field.is('select')) {
244
 
245
- if (condition_and_rule.operator == 'not equals') {
246
  condition_ok = true;
247
  }
248
 
@@ -250,13 +252,13 @@ var wpcf7cf = {
250
  var $option = jQuery(this);
251
  option_val = $option.val()
252
  if (
253
- condition_and_rule.operator == 'equals' && option_val == condition_and_rule.if_value ||
254
- condition_and_rule.operator == 'equals (regex)' && regex_patt.test($option.val())
255
  ) {
256
  condition_ok = true;
257
  } else if (
258
- condition_and_rule.operator == 'not equals' && option_val == condition_and_rule.if_value ||
259
- condition_and_rule.operator == 'not equals (regex)' && !regex_patt.test($option.val())
260
  ) {
261
  condition_ok = false;
262
  return false; // break out of the loop
@@ -266,32 +268,42 @@ var wpcf7cf = {
266
  show_group = show_group && condition_ok;
267
  }
268
 
269
- if ($field.attr('type') == 'checkbox') {
 
 
 
 
270
  if (
271
- condition_and_rule.operator == 'equals' && $field.is(':checked') && $field.val() == condition_and_rule.if_value ||
272
- condition_and_rule.operator == 'not equals' && !$field.is(':checked') ||
273
- condition_and_rule.operator == 'is empty' && !$field.is(':checked') ||
274
- condition_and_rule.operator == 'not empty' && $field.is(':checked') ||
275
- condition_and_rule.operator == '>' && $field.is(':checked') && $field.val() > condition_and_rule.if_value ||
276
- condition_and_rule.operator == '<' && $field.is(':checked') && $field.val() < condition_and_rule.if_value ||
277
- condition_and_rule.operator == '>=' && $field.is(':checked') && $field.val() >= condition_and_rule.if_value ||
278
- condition_and_rule.operator == '<=' && $field.is(':checked') && $field.val() <= condition_and_rule.if_value ||
279
- condition_and_rule.operator == 'equals (regex)' && $field.is(':checked') && regex_patt.test($field.val()) ||
280
- condition_and_rule.operator == 'not equals (regex)' && !$field.is(':checked')
 
281
  ) {
282
  condition_ok = true;
283
  }
284
  } else if (
285
- ( condition_and_rule.operator == 'equals' && $field.val() == condition_and_rule.if_value ) ||
286
- ( condition_and_rule.operator == 'not equals' && $field.val() != condition_and_rule.if_value ) ||
287
- ( condition_and_rule.operator == 'equals (regex)' && regex_patt.test($field.val()) ) ||
288
- ( condition_and_rule.operator == 'not equals (regex)' && !regex_patt.test($field.val()) ) ||
289
- ( condition_and_rule.operator == '>' && $field.val() > condition_and_rule.if_value ) ||
290
- ( condition_and_rule.operator == '<' && $field.val() < condition_and_rule.if_value ) ||
291
- ( condition_and_rule.operator == '>=' && $field.val() >= condition_and_rule.if_value ) ||
292
- ( condition_and_rule.operator == '<=' && $field.val() <= condition_and_rule.if_value ) ||
293
- ( condition_and_rule.operator == 'is empty' && $field.val() == '' ) ||
294
- ( condition_and_rule.operator == 'not empty' && $field.val() != '' )
 
 
 
 
 
295
  ) {
296
  condition_ok = true;
297
  }
@@ -310,27 +322,29 @@ var wpcf7cf = {
310
  }
311
  });
312
 
313
- var checked_value_index = jQuery.inArray(condition_and_rule.if_value, checked_values);
314
- var value_index = jQuery.inArray(condition_and_rule.if_value, all_values);
315
 
316
  if (
317
- ( condition_and_rule.operator == 'is empty' && checked_values.length == 0 ) ||
318
- ( condition_and_rule.operator == 'not empty' && checked_values.length > 0 )
319
  ) {
320
  condition_ok = true;
321
  }
322
 
323
 
324
  for (var ind = 0; ind < checked_values.length; ind++) {
 
 
325
  if (
326
- ( condition_and_rule.operator == 'equals' && checked_values[ind] == condition_and_rule.if_value ) ||
327
- ( condition_and_rule.operator == 'not equals' && checked_values[ind] != condition_and_rule.if_value ) ||
328
- ( condition_and_rule.operator == 'equals (regex)' && regex_patt.test(checked_values[ind]) ) ||
329
- ( condition_and_rule.operator == 'not equals (regex)' && !regex_patt.test(checked_values[ind]) ) ||
330
- ( condition_and_rule.operator == '>' && checked_values[ind] > condition_and_rule.if_value ) ||
331
- ( condition_and_rule.operator == '<' && checked_values[ind] < condition_and_rule.if_value ) ||
332
- ( condition_and_rule.operator == '>=' && checked_values[ind] >= condition_and_rule.if_value ) ||
333
- ( condition_and_rule.operator == '<=' && checked_values[ind] <= condition_and_rule.if_value )
334
  ) {
335
  condition_ok = true;
336
  }
@@ -351,6 +365,14 @@ jQuery('.wpcf7-form').each(function(){
351
  wpcf7cf_forms.push(new Wpcf7cfForm(jQuery(this)));
352
  });
353
 
 
 
 
 
 
 
 
 
354
  // fix for exclusive checkboxes in IE (this will call the change-event again after all other checkboxes are unchecked, triggering the display_fields() function)
355
  var old_wpcf7ExclusiveCheckbox = jQuery.fn.wpcf7ExclusiveCheckbox;
356
  jQuery.fn.wpcf7ExclusiveCheckbox = function() {
3
  var wpcf7cf_timeout;
4
 
5
  var wpcf7cf_show_animation = { "height": "show", "marginTop": "show", "marginBottom": "show", "paddingTop": "show", "paddingBottom": "show" };
6
+ var wpcf7cf_hide_animation = { "height": "hide", "marginTop": "hide", "marginBottom": "hide", "paddingTop": "hide", "paddingBottom": "hide" };
7
 
8
+ var wpcf7cf_show_step_animation = { "width": "show", "marginLeft": "show", "marginRight": "show", "paddingRight": "show", "paddingLeft": "show" };
9
+ var wpcf7cf_hide_step_animation = { "width": "hide", "marginLeft": "hide", "marginRight": "hide", "paddingRight": "hide", "paddingLeft": "hide" };
10
+
11
+ var wpcf7cf_change_events = 'input.wpcf7cf paste.wpcf7cf change.wpcf7cf click.wpcf7cf propertychange.wpcf7cf';
12
 
13
  var wpcf7cf_forms = [];
14
 
36
 
37
  form.$groups = [];
38
  form.repeaters = [];
39
+ form.multistep = null;
40
  form.fields = [];
41
 
42
  form.settings.animation_intime = parseInt(form.settings.animation_intime);
135
  });
136
 
137
  form.updateHiddenFields();
138
+ };
139
  Wpcf7cfForm.prototype.updateHiddenFields = function() {
140
 
141
  var form = this;
165
  form.$visible_groups.val(JSON.stringify(visible_groups));
166
 
167
  return true;
168
+ };
169
  Wpcf7cfForm.prototype.updateGroups = function() {
170
  var form = this;
171
  form.$groups = form.$form.find('[data-class="wpcf7cf_group"]');
192
  });
193
  });
194
 
195
+ };
 
196
  Wpcf7cfForm.prototype.updateEventListeners = function() {
197
 
198
  var form = this;
207
  });
208
 
209
  //removed pro functions
210
+ };
 
211
 
212
  //removed pro functions
213
 
 
214
  var wpcf7cf = {
215
 
216
  // keep this for backwards compatibility
230
 
231
  var condition_and_rule = condition.and_rules[and_rule_i];
232
 
233
+ var $field = jQuery('[name="' + condition_and_rule.if_field + '"], [name="' + condition_and_rule.if_field + '[]"], [data-original-name="' + condition_and_rule.if_field + '"], [data-original-name="' + condition_and_rule.if_field + '[]"]',$current_form);
234
 
235
+ var if_val = condition_and_rule.if_value;
236
+ var if_val_as_number = isFinite(parsedval=parseFloat(if_val)) ? parsedval:0;
237
+ var operator = condition_and_rule.operator;
238
+ var regex_patt = new RegExp(if_val, 'i');
239
 
 
240
 
241
+ if ($field.length === 1) {
242
 
243
  // single field (tested with text field, single checkbox, select with single value (dropdown), select with multiple values)
244
 
245
  if ($field.is('select')) {
246
 
247
+ if (operator === 'not equals') {
248
  condition_ok = true;
249
  }
250
 
252
  var $option = jQuery(this);
253
  option_val = $option.val()
254
  if (
255
+ operator === 'equals' && option_val === if_val ||
256
+ operator === 'equals (regex)' && regex_patt.test($option.val())
257
  ) {
258
  condition_ok = true;
259
  } else if (
260
+ operator === 'not equals' && option_val === if_val ||
261
+ operator === 'not equals (regex)' && !regex_patt.test($option.val())
262
  ) {
263
  condition_ok = false;
264
  return false; // break out of the loop
268
  show_group = show_group && condition_ok;
269
  }
270
 
271
+ var field_val = $field.val();
272
+ var field_val_as_number = isFinite(parsedval=parseFloat(field_val)) ? parsedval:0;
273
+
274
+ if ($field.attr('type') === 'checkbox') {
275
+ var field_is_checked = $field.is(':checked');
276
  if (
277
+ operator === 'equals' && field_is_checked && field_val === if_val ||
278
+ operator === 'not equals' && !field_is_checked ||
279
+ operator === 'is empty' && !field_is_checked ||
280
+ operator === 'not empty' && field_is_checked ||
281
+ operator === '>' && field_is_checked && field_val_as_number > if_val_as_number ||
282
+ operator === '<' && field_is_checked && field_val_as_number < if_val_as_number ||
283
+ operator === '' && field_is_checked && field_val_as_number >= if_val_as_number ||
284
+ operator === '' && field_is_checked && field_val_as_number <= if_val_as_number ||
285
+ operator === 'equals (regex)' && field_is_checked && regex_patt.test(field_val) ||
286
+ operator === 'not equals (regex)' && !field_is_checked
287
+
288
  ) {
289
  condition_ok = true;
290
  }
291
  } else if (
292
+ operator === 'equals' && field_val === if_val ||
293
+ operator === 'not equals' && field_val !== if_val ||
294
+ operator === 'equals (regex)' && regex_patt.test(field_val) ||
295
+ operator === 'not equals (regex)' && !regex_patt.test(field_val) ||
296
+ operator === '>' && field_val_as_number > if_val_as_number ||
297
+ operator === '<' && field_val_as_number < if_val_as_number ||
298
+ operator === '' && field_val_as_number >= if_val_as_number ||
299
+ operator === '' && field_val_as_number <= if_val_as_number ||
300
+ operator === 'is empty' && field_val === '' ||
301
+ operator === 'not empty' && field_val !== '' ||
302
+ (
303
+ operator === 'function'
304
+ && typeof window[if_val] == 'function'
305
+ && window[if_val]($field)
306
+ )
307
  ) {
308
  condition_ok = true;
309
  }
322
  }
323
  });
324
 
325
+ var checked_value_index = jQuery.inArray(if_val, checked_values);
326
+ var value_index = jQuery.inArray(if_val, all_values);
327
 
328
  if (
329
+ ( operator === 'is empty' && checked_values.length === 0 ) ||
330
+ ( operator === 'not empty' && checked_values.length > 0 )
331
  ) {
332
  condition_ok = true;
333
  }
334
 
335
 
336
  for (var ind = 0; ind < checked_values.length; ind++) {
337
+ var checked_val = checked_values[ind];
338
+ var checked_val_as_number = isFinite(parsedval=parseFloat(checked_val)) ? parsedval:0;
339
  if (
340
+ ( operator === 'equals' && checked_val === if_val ) ||
341
+ ( operator === 'not equals' && checked_val !== if_val ) ||
342
+ ( operator === 'equals (regex)' && regex_patt.test(checked_val) ) ||
343
+ ( operator === 'not equals (regex)' && !regex_patt.test(checked_val) ) ||
344
+ ( operator === '>' && checked_val_as_number > if_val_as_number ) ||
345
+ ( operator === '<' && checked_val_as_number < if_val_as_number ) ||
346
+ ( operator === '' && checked_val_as_number >= if_val_as_number ) ||
347
+ ( operator === '' && checked_val_as_number <= if_val_as_number )
348
  ) {
349
  condition_ok = true;
350
  }
365
  wpcf7cf_forms.push(new Wpcf7cfForm(jQuery(this)));
366
  });
367
 
368
+ // Call displayFields again on all forms
369
+ // Necessary in case some theme or plugin changed a form value by the time the entire page is fully loaded.
370
+ jQuery('document').ready(function() {
371
+ wpcf7cf_forms.forEach(function(f){
372
+ f.displayFields();
373
+ });
374
+ });
375
+
376
  // fix for exclusive checkboxes in IE (this will call the change-event again after all other checkboxes are unchecked, triggering the display_fields() function)
377
  var old_wpcf7ExclusiveCheckbox = jQuery.fn.wpcf7ExclusiveCheckbox;
378
  jQuery.fn.wpcf7ExclusiveCheckbox = function() {
js/scripts_admin.js CHANGED
@@ -57,22 +57,7 @@ if ($wpcf7cf_new_entry.length > 0) {
57
 
58
  // START: code here will be executed after the _wpcf7.taggen.update function
59
  if (tagType== 'group') ret += "[/group]";
60
- if (tagType== 'repeater') {
61
-
62
- // $min = $('#tag-generator-panel-repeater-min');
63
- // $max = $('#tag-generator-panel-repeater-max');
64
- // var min = $min.val();
65
- // var max = $max.val();
66
- //
67
- // if (min == "") min = $min.data('default');
68
- // if (max == "") max = $max.data('default');
69
- //
70
- // str_val = ' "'+min+'" "'+max+'"';
71
- //
72
- // ret = ret.replace(']', str_val+']');
73
-
74
- ret += "[/repeater]";
75
- }
76
 
77
  // END
78
 
57
 
58
  // START: code here will be executed after the _wpcf7.taggen.update function
59
  if (tagType== 'group') ret += "[/group]";
60
+ if (tagType== 'repeater') ret += "[/repeater]";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  // END
63
 
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === Conditional Fields for Contact Form 7 ===
2
  Contributors: Jules Colle
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=j_colle%40hotmail%2ecom&lc=US&item_name=Jules%20Colle%20%2d%20WP%20plugins%20%2d%20Responsive%20Gallery%20Grid&item_number=rgg&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Author: Jules Colle
@@ -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.2
9
- Stable tag: 1.6.1
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,12 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
105
  = 1.6.1 (06-03-19) =
106
  * JS refactoring and small compatibility fix after code rewrite.
107
  * FREE: Added "Get PRO" button under Contact > Conditional Fields
@@ -135,7 +141,7 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
135
  * Fixed bug that could appear after removing an AND condition.
136
  * solve WPCF7_ADMIN_READ_WRITE_CAPABILITY - https://github.com/pwkip/contact-form-7-conditional-fields/pull/16
137
  * disable part of the faulty remove_hidden_post_data function. - https://github.com/pwkip/contact-form-7-conditional-fields/pull/17
138
- * Fix "Dismiss notice" on Conditional Fields for Contact Form 7 Settings page
139
  * use the "wpcf7_before_send_mail" hook instead of "wpcf7_mail_components" to hide mail groups. The wpcf7_before_send_mail hook is called earlier, so it allows to also hide groups in the attachment field and in messages.
140
  * Allow conditional group tags in success and error messages. https://github.com/pwkip/contact-form-7-conditional-fields/issues/23
141
  * duplicating a form will also duplicate conditions https://github.com/pwkip/contact-form-7-conditional-fields/issues/28
1
+ === Contact Form 7 - Conditional Fields Pro ===
2
  Contributors: Jules Colle
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=j_colle%40hotmail%2ecom&lc=US&item_name=Jules%20Colle%20%2d%20WP%20plugins%20%2d%20Responsive%20Gallery%20Grid&item_number=rgg&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Author: Jules Colle
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
  Tested up to: 5.2
9
+ Stable tag: 1.6.2
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.6.2 (06-15-19) =
106
+ * Small changes to tag generator buttons
107
+ * Multistep bug fix. All group conditions are evaluated a second time after the page has fully loaded.
108
+ * PRO: added new operator 'function', allowing you to write custom javascript functions to determine whether or not a group should be shown https://conditional-fields-cf7.bdwm.be/advanced-conditional-logic-with-custom-javascript-functions/
109
+ * PRO: fix bug with < (less than) operator
110
+
111
  = 1.6.1 (06-03-19) =
112
  * JS refactoring and small compatibility fix after code rewrite.
113
  * FREE: Added "Get PRO" button under Contact > Conditional Fields
141
  * Fixed bug that could appear after removing an AND condition.
142
  * solve WPCF7_ADMIN_READ_WRITE_CAPABILITY - https://github.com/pwkip/contact-form-7-conditional-fields/pull/16
143
  * disable part of the faulty remove_hidden_post_data function. - https://github.com/pwkip/contact-form-7-conditional-fields/pull/17
144
+ * Fix "Dismiss notice" on Conditional Fields Settings page
145
  * use the "wpcf7_before_send_mail" hook instead of "wpcf7_mail_components" to hide mail groups. The wpcf7_before_send_mail hook is called earlier, so it allows to also hide groups in the attachment field and in messages.
146
  * Allow conditional group tags in success and error messages. https://github.com/pwkip/contact-form-7-conditional-fields/issues/23
147
  * duplicating a form will also duplicate conditions https://github.com/pwkip/contact-form-7-conditional-fields/issues/28
style.css CHANGED
@@ -7,8 +7,12 @@
7
  margin-bottom: 20px;
8
  }
9
 
10
- .wpcf7cf_repeater_controls {
11
  display: flex;
12
  justify-content: space-between;
13
  flex-wrap: wrap;
 
 
 
 
14
  }
7
  margin-bottom: 20px;
8
  }
9
 
10
+ .wpcf7cf_repeater_controls, .wpcf7cf_step_controls {
11
  display: flex;
12
  justify-content: space-between;
13
  flex-wrap: wrap;
14
+ }
15
+
16
+ .wpcf7cf_multistep .wpcf7cf_step {
17
+ display:none;
18
  }
wpcf7cf-options.php CHANGED
@@ -74,9 +74,9 @@ function wpcf7cf_options_page() {
74
 
75
  <div class="wrap wpcf7cf-admin-wrap">
76
  <?php screen_icon(); ?>
77
- <h2>Conditional Fields for Contact Form 7 Settings</h2>
78
  <?php if (!$wpcf7cf_options['notice_dismissed']) { ?>
79
- <div class="wpcf7cf-options-notice notice notice-warning is-dismissible"><div style="padding: 10px 0;"><strong>Notice</strong>: These are global settings for Conditional Fields for Contact Form 7. <br><br><strong>How to create/edit conditional fields?</strong>
80
  <ol>
81
  <li>Create a new Contact Form or edit an existing one</li>
82
  <li>Create at least one [group] inside the form</li>
@@ -123,7 +123,7 @@ function wpcf7cf_options_page() {
123
  <li>Repeaters</li>
124
  <li>Regular expressions</li>
125
  <li>Togglebuttons</li>
126
- <li>Additional operators <code>&lt;</code> <code>&gt;</code> <code>≤</code> <code>≥</code> <code>is empty</code></li>
127
  <li>More comming soon (Multistep, Calculated Fields, ...)</li>
128
  </ul>
129
  <p><a target="_blank" class="button button-primary" href="https://conditional-fields-cf7.bdwm.be/contact-form-7-conditional-fields-pro/">Get PRO</a></p>
74
 
75
  <div class="wrap wpcf7cf-admin-wrap">
76
  <?php screen_icon(); ?>
77
+ <h2>Contact Form 7 - Conditional Fields Settings</h2>
78
  <?php if (!$wpcf7cf_options['notice_dismissed']) { ?>
79
+ <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>
80
  <ol>
81
  <li>Create a new Contact Form or edit an existing one</li>
82
  <li>Create at least one [group] inside the form</li>
123
  <li>Repeaters</li>
124
  <li>Regular expressions</li>
125
  <li>Togglebuttons</li>
126
+ <li>Additional operators <code>&lt;</code> <code>&gt;</code> <code>&le;</code> <code>&ge;</code> <code>is empty</code></li>
127
  <li>More comming soon (Multistep, Calculated Fields, ...)</li>
128
  </ul>
129
  <p><a target="_blank" class="button button-primary" href="https://conditional-fields-cf7.bdwm.be/contact-form-7-conditional-fields-pro/">Get PRO</a></p>