Conditional Fields for Contact Form 7 - Version 1.5.2

Version Description

(05-03-19)= * by reverting changes in 1.5.1, the possibility to load forms via AJAX was destroyed. So, from now on the wpcf7cf scripts will be loaded in the 'wp_enqueue_scripts' hook. Analogous with the WPCF7_LOAD_JS constant, a new constant is defined called WPCF7CF_LOAD_JS wich is set to true by default.

Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

Files changed (4) hide show
  1. cf7cf.php +4 -2
  2. contact-form-7-conditional-fields.php +1 -1
  3. init.php +3 -1
  4. readme.txt +4 -1
cf7cf.php CHANGED
@@ -10,7 +10,7 @@ class ContactForm7ConditionalFields {
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
@@ -91,7 +91,9 @@ class ContactForm7ConditionalFields {
91
 
92
  public static function enqueue_js() {
93
  if (is_admin()) return;
94
- wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
 
 
95
  }
96
 
97
  public static function enqueue_css() {
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('wp_enqueue_scripts', array(__CLASS__, 'enqueue_js'));
14
  add_action('wpcf7_enqueue_styles', array(__CLASS__, 'enqueue_css'));
15
 
16
  // Register shortcodes
91
 
92
  public static function enqueue_js() {
93
  if (is_admin()) return;
94
+ if (WPCF7CF_LOAD_JS) {
95
+ wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
96
+ }
97
  }
98
 
99
  public static function enqueue_css() {
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.1
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.2
8
  Author URI: http://bdwm.be/
9
  */
10
 
init.php CHANGED
@@ -1,12 +1,14 @@
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 ) );
7
  if (!defined('WPCF7CF_PLUGIN_NAME')) define( 'WPCF7CF_PLUGIN_NAME', trim( dirname( WPCF7CF_PLUGIN_BASENAME ), '/' ) );
8
  if (!defined('WPCF7CF_PLUGIN_DIR')) define( 'WPCF7CF_PLUGIN_DIR', untrailingslashit( dirname( WPCF7CF_PLUGIN ) ) );
9
 
 
 
10
  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');
11
 
12
 
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.5.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 ) );
7
  if (!defined('WPCF7CF_PLUGIN_NAME')) define( 'WPCF7CF_PLUGIN_NAME', trim( dirname( WPCF7CF_PLUGIN_BASENAME ), '/' ) );
8
  if (!defined('WPCF7CF_PLUGIN_DIR')) define( 'WPCF7CF_PLUGIN_DIR', untrailingslashit( dirname( WPCF7CF_PLUGIN ) ) );
9
 
10
+ if (!defined('WPCF7CF_LOAD_JS')) define('WPCF7CF_LOAD_JS', true);
11
+
12
  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');
13
 
14
 
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.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,6 +102,9 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
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
 
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.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.5.2 (05-03-19)=
106
+ * by reverting changes in 1.5.1, the possibility to load forms via AJAX was destroyed. So, from now on the wpcf7cf scripts will be loaded in the 'wp_enqueue_scripts' hook. Analogous with the WPCF7_LOAD_JS constant, a new constant is defined called WPCF7CF_LOAD_JS wich is set to true by default.
107
+
108
  = 1.5.1 (05-02-19) =
109
  * 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).
110