Conditional Fields for Contact Form 7 - Version 1.5.1

Version Description

(05-02-19) = * revert changes: enqueue scripts in 'wpcf7_contact_form' hook instead of 'wpcf7_enqueue_scripts', because loading it in the latter would cause problems with plugins that disable WPCF7_LOAD_JS (like for example contact-form-7-paypal-add-on).

Download this release

Release Info

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

Code changes from version 1.5 to 1.5.1

Files changed (4) hide show
  1. cf7cf.php +7 -2
  2. contact-form-7-conditional-fields.php +1 -1
  3. init.php +6 -2
  4. readme.txt +5 -2
cf7cf.php CHANGED
@@ -7,8 +7,11 @@ class ContactForm7ConditionalFields {
7
 
8
  function __construct() {
9
 
10
- add_action('wpcf7_enqueue_scripts', array(__CLASS__, 'enqueue_js'));
11
- add_action('wpcf7_enqueue_styles', array(__CLASS__, 'enqueue_css'));
 
 
 
12
 
13
  // Register shortcodes
14
  add_action('wpcf7_init', array(__CLASS__, 'add_shortcodes'));
@@ -340,6 +343,8 @@ function wpcf7cf_form_hidden_fields($hidden_fields) {
340
  'settings' => get_option(WPCF7CF_OPTIONS)
341
  );
342
 
 
 
343
  return array_merge($hidden_fields, array(
344
  '_wpcf7cf_hidden_group_fields' => '',
345
  '_wpcf7cf_hidden_groups' => '',
7
 
8
  function __construct() {
9
 
10
+ // can't use wpcf7_enqueue_scripts hook, because it's possible that people
11
+ // want to disable the CF7 scripts. but in this case Conditional fields should still work.
12
+ // add_action('wpcf7_enqueue_scripts', array(__CLASS__, 'enqueue_js')); // <-- don't use this
13
+ add_action('wpcf7_contact_form', array(__CLASS__, 'enqueue_js'));
14
+ add_action('wpcf7_enqueue_styles', array(__CLASS__, 'enqueue_css'));
15
 
16
  // Register shortcodes
17
  add_action('wpcf7_init', array(__CLASS__, 'add_shortcodes'));
343
  'settings' => get_option(WPCF7CF_OPTIONS)
344
  );
345
 
346
+ unset($options['settings']['license_key']); // don't show license key in the source code duh.
347
+
348
  return array_merge($hidden_fields, array(
349
  '_wpcf7cf_hidden_group_fields' => '',
350
  '_wpcf7cf_hidden_groups' => '',
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.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.5.1
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.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 ) );
@@ -33,4 +33,8 @@ if (WPCF7CF_IS_PRO) {
33
  }
34
 
35
  require_once WPCF7CF_PLUGIN_DIR.'/cf7cf.php';
36
- require_once WPCF7CF_PLUGIN_DIR.'/wpcf7cf-options.php';
 
 
 
 
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.5.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 ) );
33
  }
34
 
35
  require_once WPCF7CF_PLUGIN_DIR.'/cf7cf.php';
36
+ require_once WPCF7CF_PLUGIN_DIR.'/wpcf7cf-options.php';
37
+
38
+ if (WPCF7CF_IS_PRO) {
39
+ require_once WPCF7CF_PLUGIN_DIR.'/pro/update.php';
40
+ }
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Conditional Fields for Contact Form 7 ===
2
- Contributors: Jules Colle, stevish
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
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
  Tested up to: 5.1.1
9
- Stable tag: 1.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,9 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
102
 
103
  == Changelog ==
104
 
 
 
 
105
  = 1.5 (04-21-19) =
106
  * Make it possible to load forms with AJAX https://github.com/pwkip/contact-form-7-conditional-fields/issues/25 and https://conditional-fields-cf7.bdwm.be/docs/faq/how-to-initialize-the-conditional-logic-after-an-ajax-call/
107
  * Massive code reorganization in scripts.js
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
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 4.1
8
  Tested up to: 5.1.1
9
+ Stable tag: 1.5.1
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.5.1 (05-02-19) =
106
+ * revert changes: enqueue scripts in 'wpcf7_contact_form' hook instead of 'wpcf7_enqueue_scripts', because loading it in the latter would cause problems with plugins that disable WPCF7_LOAD_JS (like for example contact-form-7-paypal-add-on).
107
+
108
  = 1.5 (04-21-19) =
109
  * Make it possible to load forms with AJAX https://github.com/pwkip/contact-form-7-conditional-fields/issues/25 and https://conditional-fields-cf7.bdwm.be/docs/faq/how-to-initialize-the-conditional-logic-after-an-ajax-call/
110
  * Massive code reorganization in scripts.js