Version Description
- Changes tested with WP 4.7.5 and CF7 4.8
- Changed the inner mechanics a bit to make the plugin more edge-case proof and prepare for future ajax support
- Fix problems introduced by CF7 4.8 update
- Because the CF7 author, Takayuki Miyoshi, decided to get rid of the 'form-pre-serialize' javascript event, the hidden fields containing data about which groups are shown/hidden will now be updated when the form is loaded and each time a form value changes. This might make the plugin slightly slower, but it is the only solution I found so far.
- Small bug fix (https://wordpress.org/support/topic/php-depreciated-warning/#post-9151404)
Download this release
Release Info
Developer | Jules Colle |
Plugin | Conditional Fields for Contact Form 7 |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 1.3.3
- admin.php +6 -6
- cf7cf.php +20 -56
- contact-form-7-conditional-fields.php +4 -4
- js/scripts.js +19 -15
- js/scripts_admin.js +2 -9
- readme.txt +10 -3
- tg_pane_group.php +26 -0
admin.php
CHANGED
@@ -22,7 +22,7 @@ function add_conditional_panel($panels) {
|
|
22 |
return $panels;
|
23 |
}
|
24 |
|
25 |
-
function
|
26 |
$all_fields = $post->scan_form_tags();
|
27 |
?>
|
28 |
<option value="-1" <?php echo $selected == '-1'?'selected':'' ?>>-- Select field --</option>
|
@@ -35,7 +35,7 @@ function all_field_options($post, $selected = '-1') {
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
-
function
|
39 |
$all_groups = $post->scan_form_tags(array('type'=>'group'));
|
40 |
|
41 |
?>
|
@@ -74,11 +74,11 @@ function wpcf7cf_editor_panel_conditional($form) {
|
|
74 |
|
75 |
<div id="wpcf7cf-new-entry">
|
76 |
if
|
77 |
-
<select name="wpcf7cf_options[{id}][if_field]" class="if-field-select"><?php
|
78 |
<select name="wpcf7cf_options[{id}][operator]" class="operator"><?php all_operator_options(); ?></select>
|
79 |
<input name="wpcf7cf_options[{id}][if_value]" class="if-value" type="text" placeholder="value">
|
80 |
then show
|
81 |
-
<select name="wpcf7cf_options[{id}][then_field]" class="then-field-select"><?php
|
82 |
</div>
|
83 |
<a id="wpcf7cf-delete-button" class="delete-button" title="delete rule" href="#"><span class="dashicons dashicons-dismiss"></span> Remove rule</a>
|
84 |
<a id="wpcf7cf-add-button" title="add new rule" href="#"><span class="dashicons dashicons-plus-alt"></span> add new conditional rule</a>
|
@@ -90,11 +90,11 @@ function wpcf7cf_editor_panel_conditional($form) {
|
|
90 |
?>
|
91 |
<div class="entry" id="entry-<?php echo $i ?>">
|
92 |
if
|
93 |
-
<select name="wpcf7cf_options[<?php echo $i ?>][if_field]" class="if-field-select"><?php
|
94 |
<select name="wpcf7cf_options[<?php echo $i ?>][operator]" class="operator"><?php all_operator_options($entry['operator']) ?></select>
|
95 |
<input name="wpcf7cf_options[<?php echo $i ?>][if_value]" class="if-value" type="text" placeholder="value" value="<?php echo $entry['if_value'] ?>">
|
96 |
then show
|
97 |
-
<select name="wpcf7cf_options[<?php echo $i ?>][then_field]" class="then-field-select"><?php
|
98 |
<a style="display: inline-block;" href="#" title="delete rule" class="delete-button"><span class="dashicons dashicons-dismiss"></span> Remove rule</a>
|
99 |
</div>
|
100 |
<?php
|
22 |
return $panels;
|
23 |
}
|
24 |
|
25 |
+
function wpcf7cf_all_field_options($post, $selected = '-1') {
|
26 |
$all_fields = $post->scan_form_tags();
|
27 |
?>
|
28 |
<option value="-1" <?php echo $selected == '-1'?'selected':'' ?>>-- Select field --</option>
|
35 |
}
|
36 |
}
|
37 |
|
38 |
+
function wpcf7cf_all_group_options($post, $selected = '-1') {
|
39 |
$all_groups = $post->scan_form_tags(array('type'=>'group'));
|
40 |
|
41 |
?>
|
74 |
|
75 |
<div id="wpcf7cf-new-entry">
|
76 |
if
|
77 |
+
<select name="wpcf7cf_options[{id}][if_field]" class="if-field-select"><?php wpcf7cf_all_field_options($form); ?></select>
|
78 |
<select name="wpcf7cf_options[{id}][operator]" class="operator"><?php all_operator_options(); ?></select>
|
79 |
<input name="wpcf7cf_options[{id}][if_value]" class="if-value" type="text" placeholder="value">
|
80 |
then show
|
81 |
+
<select name="wpcf7cf_options[{id}][then_field]" class="then-field-select"><?php wpcf7cf_all_group_options($form); ?></select>
|
82 |
</div>
|
83 |
<a id="wpcf7cf-delete-button" class="delete-button" title="delete rule" href="#"><span class="dashicons dashicons-dismiss"></span> Remove rule</a>
|
84 |
<a id="wpcf7cf-add-button" title="add new rule" href="#"><span class="dashicons dashicons-plus-alt"></span> add new conditional rule</a>
|
90 |
?>
|
91 |
<div class="entry" id="entry-<?php echo $i ?>">
|
92 |
if
|
93 |
+
<select name="wpcf7cf_options[<?php echo $i ?>][if_field]" class="if-field-select"><?php wpcf7cf_all_field_options($form, $entry['if_field']); ?></select>
|
94 |
<select name="wpcf7cf_options[<?php echo $i ?>][operator]" class="operator"><?php all_operator_options($entry['operator']) ?></select>
|
95 |
<input name="wpcf7cf_options[<?php echo $i ?>][if_value]" class="if-value" type="text" placeholder="value" value="<?php echo $entry['if_value'] ?>">
|
96 |
then show
|
97 |
+
<select name="wpcf7cf_options[<?php echo $i ?>][then_field]" class="then-field-select"><?php wpcf7cf_all_group_options($form, $entry['then_field']); ?></select>
|
98 |
<a style="display: inline-block;" href="#" title="delete rule" class="delete-button"><span class="dashicons dashicons-dismiss"></span> Remove rule</a>
|
99 |
</div>
|
100 |
<?php
|
cf7cf.php
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
global $wpcf7cf_global_count;
|
4 |
-
|
5 |
class ContactForm7ConditionalFields {
|
6 |
private $hidden_fields = array();
|
7 |
private $visible_groups = array();
|
@@ -52,8 +50,6 @@ class ContactForm7ConditionalFields {
|
|
52 |
}
|
53 |
|
54 |
public static function add_shortcodes() {
|
55 |
-
//wpcf7_add_shortcode('group', array(__CLASS__, 'shortcode_handler'), true);
|
56 |
-
//add_shortcode( 'group', array(__CLASS__, 'group_shortcode_handler') );
|
57 |
if (function_exists('wpcf7_add_form_tag'))
|
58 |
wpcf7_add_form_tag('group', array(__CLASS__, 'shortcode_handler'), true);
|
59 |
else if (function_exists('wpcf7_add_shortcode')) {
|
@@ -67,7 +63,7 @@ class ContactForm7ConditionalFields {
|
|
67 |
return $content;
|
68 |
}
|
69 |
|
70 |
-
function shortcode_handler($tag) {
|
71 |
//$tag = new WPCF7_Shortcode($tag);
|
72 |
$tag = new WPCF7_FormTag($tag);
|
73 |
//ob_start();
|
@@ -86,6 +82,8 @@ class ContactForm7ConditionalFields {
|
|
86 |
'wpcf7-tg-pane-group',
|
87 |
array(__CLASS__, 'tg_pane')
|
88 |
);
|
|
|
|
|
89 |
}
|
90 |
|
91 |
static function tg_pane( $contact_form, $args = '' ) {
|
@@ -94,34 +92,7 @@ class ContactForm7ConditionalFields {
|
|
94 |
|
95 |
$description = __( "Generate a group tag to group form elements that can be shown conditionally.", 'cf7cf' );
|
96 |
|
97 |
-
|
98 |
-
<div class="control-box">
|
99 |
-
<fieldset>
|
100 |
-
<legend><?php echo sprintf( esc_html( $description ) ); ?></legend>
|
101 |
-
|
102 |
-
<table class="form-table">
|
103 |
-
<tbody>
|
104 |
-
|
105 |
-
<tr>
|
106 |
-
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th>
|
107 |
-
<td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
|
108 |
-
</tr>
|
109 |
-
|
110 |
-
</tbody>
|
111 |
-
</table>
|
112 |
-
</fieldset>
|
113 |
-
</div>
|
114 |
-
|
115 |
-
<div class="insert-box">
|
116 |
-
<input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
|
117 |
-
|
118 |
-
<div class="submitbox">
|
119 |
-
<input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
|
120 |
-
</div>
|
121 |
-
|
122 |
-
<br class="clear" />
|
123 |
-
</div>
|
124 |
-
<?php
|
125 |
}
|
126 |
|
127 |
/**
|
@@ -286,7 +257,7 @@ new ContactForm7ConditionalFields;
|
|
286 |
add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
|
287 |
|
288 |
function wpcf7cf_properties($properties, $wpcf7form) {
|
289 |
-
if (!is_admin()) { // TODO: kind of hacky. maybe find a better solution. Needed because otherwise the group tags will be replaced in the editor as well.
|
290 |
$form = $properties['form'];
|
291 |
|
292 |
$find = array(
|
@@ -309,38 +280,31 @@ function wpcf7cf_properties($properties, $wpcf7form) {
|
|
309 |
return $properties;
|
310 |
}
|
311 |
|
312 |
-
$wpcf7cf_global_count = 0;
|
313 |
-
|
314 |
add_action('wpcf7_contact_form', 'wpcf7cf_enqueue_scripts', 10, 1);
|
315 |
function wpcf7cf_enqueue_scripts(WPCF7_ContactForm $cf7form) {
|
316 |
-
|
317 |
if (is_admin()) return;
|
|
|
|
|
318 |
|
319 |
-
|
320 |
-
$wpcf7cf_global_count++;
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
$unit_tag = 'wpcf7-f'.$cf7form->id().'-o'.$wpcf7cf_global_count;
|
327 |
-
}
|
328 |
|
329 |
$options = array(
|
330 |
-
'form_id' => $
|
331 |
-
'
|
332 |
-
'conditions' => get_post_meta($cf7form->id(),'wpcf7cf_options', true),
|
333 |
'settings' => get_option(WPCF7CF_OPTIONS)
|
334 |
);
|
335 |
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
function wpcf7cf_form_hidden_fields($hidden_fields) {
|
343 |
-
return array('_wpcf7cf_hidden_group_fields' => '', '_wpcf7cf_hidden_groups' => '', '_wpcf7cf_visible_groups' => '');
|
344 |
}
|
345 |
|
346 |
function wpcf7cf_endswith($string, $test) {
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
class ContactForm7ConditionalFields {
|
4 |
private $hidden_fields = array();
|
5 |
private $visible_groups = array();
|
50 |
}
|
51 |
|
52 |
public static function add_shortcodes() {
|
|
|
|
|
53 |
if (function_exists('wpcf7_add_form_tag'))
|
54 |
wpcf7_add_form_tag('group', array(__CLASS__, 'shortcode_handler'), true);
|
55 |
else if (function_exists('wpcf7_add_shortcode')) {
|
63 |
return $content;
|
64 |
}
|
65 |
|
66 |
+
public static function shortcode_handler($tag) {
|
67 |
//$tag = new WPCF7_Shortcode($tag);
|
68 |
$tag = new WPCF7_FormTag($tag);
|
69 |
//ob_start();
|
82 |
'wpcf7-tg-pane-group',
|
83 |
array(__CLASS__, 'tg_pane')
|
84 |
);
|
85 |
+
|
86 |
+
do_action('wpcf7cf_tag_generator');
|
87 |
}
|
88 |
|
89 |
static function tg_pane( $contact_form, $args = '' ) {
|
92 |
|
93 |
$description = __( "Generate a group tag to group form elements that can be shown conditionally.", 'cf7cf' );
|
94 |
|
95 |
+
include 'tg_pane_group.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
/**
|
257 |
add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
|
258 |
|
259 |
function wpcf7cf_properties($properties, $wpcf7form) {
|
260 |
+
if (!is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) { // TODO: kind of hacky. maybe find a better solution. Needed because otherwise the group tags will be replaced in the editor as well.
|
261 |
$form = $properties['form'];
|
262 |
|
263 |
$find = array(
|
280 |
return $properties;
|
281 |
}
|
282 |
|
|
|
|
|
283 |
add_action('wpcf7_contact_form', 'wpcf7cf_enqueue_scripts', 10, 1);
|
284 |
function wpcf7cf_enqueue_scripts(WPCF7_ContactForm $cf7form) {
|
|
|
285 |
if (is_admin()) return;
|
286 |
+
wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
|
287 |
+
}
|
288 |
|
289 |
+
add_action('wpcf7_form_hidden_fields', 'wpcf7cf_form_hidden_fields',10,1);
|
|
|
290 |
|
291 |
+
function wpcf7cf_form_hidden_fields($hidden_fields) {
|
292 |
+
|
293 |
+
$current_form = wpcf7_get_current_contact_form();
|
294 |
+
$current_form_id = $current_form->id;
|
|
|
|
|
295 |
|
296 |
$options = array(
|
297 |
+
'form_id' => $current_form_id,
|
298 |
+
'conditions' => get_post_meta($current_form_id,'wpcf7cf_options', true),
|
|
|
299 |
'settings' => get_option(WPCF7CF_OPTIONS)
|
300 |
);
|
301 |
|
302 |
+
return array(
|
303 |
+
'_wpcf7cf_hidden_group_fields' => '',
|
304 |
+
'_wpcf7cf_hidden_groups' => '',
|
305 |
+
'_wpcf7cf_visible_groups' => '',
|
306 |
+
'_wpcf7cf_options' => ''.json_encode($options),
|
307 |
+
);
|
|
|
|
|
308 |
}
|
309 |
|
310 |
function wpcf7cf_endswith($string, $test) {
|
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.3.
|
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.3.
|
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 ) );
|
@@ -43,9 +43,9 @@ function wpcf7cf_plugin_url( $path = '' ) {
|
|
43 |
return $url;
|
44 |
}
|
45 |
|
46 |
-
if(file_exists(WPCF7CF_PLUGIN_DIR.'/pro-functions.php')) {
|
47 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', true );
|
48 |
-
require_once 'pro-functions.php';
|
49 |
} else {
|
50 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', false );
|
51 |
}
|
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.3.3
|
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.3.3' );
|
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 ) );
|
43 |
return $url;
|
44 |
}
|
45 |
|
46 |
+
if(file_exists(WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php')) {
|
47 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', true );
|
48 |
+
require_once WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php';
|
49 |
} else {
|
50 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', false );
|
51 |
}
|
js/scripts.js
CHANGED
@@ -4,18 +4,27 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
4 |
|
5 |
var i=0;
|
6 |
var options = [];
|
7 |
-
while (true) {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
$(document).ready(function() {
|
17 |
function display_fields(unit_tag, wpcf7cf_conditions, wpcf7cf_settings) {
|
18 |
|
|
|
|
|
19 |
//for compatibility with contact-form-7-signature-addon
|
20 |
if (cf7signature_resized == 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) {
|
21 |
for (var i = 0; i < signatures.length; i++) {
|
@@ -165,6 +174,8 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
165 |
$group.animate(hide_animation, animation_outtime); // hide
|
166 |
}
|
167 |
});
|
|
|
|
|
168 |
}
|
169 |
|
170 |
var timeout;
|
@@ -189,13 +200,6 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
189 |
|
190 |
}
|
191 |
|
192 |
-
// before the form values are serialized to submit via ajax, we quickly add all invisible fields in the hidden
|
193 |
-
// _wpcf7cf_hidden_group_fields field, so the PHP code knows which fields were inside hidden groups.
|
194 |
-
$('form.wpcf7-form').on('form-pre-serialize', function(form,options,veto) {
|
195 |
-
$form = $(form.target);
|
196 |
-
wpcf7cf_update_hidden_fields($form);
|
197 |
-
});
|
198 |
-
|
199 |
// Also add hidden fields in case a form gets submitted without any input:
|
200 |
$('form.wpcf7-form').each(function(){
|
201 |
wpcf7cf_update_hidden_fields($(this));
|
4 |
|
5 |
var i=0;
|
6 |
var options = [];
|
7 |
+
// while (true) {
|
8 |
+
// i++;
|
9 |
+
// if ('wpcf7cf_options_'+i in window) {
|
10 |
+
// options.push(window['wpcf7cf_options_'+i]);
|
11 |
+
// continue;
|
12 |
+
// }
|
13 |
+
// break;
|
14 |
+
// }
|
15 |
+
|
16 |
+
$('.wpcf7').each(function(){
|
17 |
+
$this = $(this);
|
18 |
+
form_options = JSON.parse($this.find('input[name="_wpcf7cf_options"]').eq(0).val());
|
19 |
+
form_options.unit_tag = $this.attr('id');
|
20 |
+
options.push(form_options);
|
21 |
+
});
|
22 |
|
23 |
$(document).ready(function() {
|
24 |
function display_fields(unit_tag, wpcf7cf_conditions, wpcf7cf_settings) {
|
25 |
|
26 |
+
$current_form = $('#'+unit_tag);
|
27 |
+
|
28 |
//for compatibility with contact-form-7-signature-addon
|
29 |
if (cf7signature_resized == 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) {
|
30 |
for (var i = 0; i < signatures.length; i++) {
|
174 |
$group.animate(hide_animation, animation_outtime); // hide
|
175 |
}
|
176 |
});
|
177 |
+
|
178 |
+
wpcf7cf_update_hidden_fields($current_form);
|
179 |
}
|
180 |
|
181 |
var timeout;
|
200 |
|
201 |
}
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
// Also add hidden fields in case a form gets submitted without any input:
|
204 |
$('form.wpcf7-form').each(function(){
|
205 |
wpcf7cf_update_hidden_fields($(this));
|
js/scripts_admin.js
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
* Created by jules on 7/17/2015.
|
3 |
*/
|
4 |
|
|
|
|
|
5 |
var old_compose = _wpcf7.taggen.compose;
|
6 |
|
7 |
(function($) {
|
@@ -194,15 +196,6 @@ var old_compose = _wpcf7.taggen.compose;
|
|
194 |
update_entries();
|
195 |
});
|
196 |
|
197 |
-
// $('.if-value').autocomplete({
|
198 |
-
// source: regexes
|
199 |
-
// });
|
200 |
-
// $('.if-value').each(function() {
|
201 |
-
// $(this).data("uiAutocomplete")._renderItem = function (ul, item) {
|
202 |
-
// return $("<li></li>").append("pff").appendTo(ul);
|
203 |
-
// }
|
204 |
-
// });
|
205 |
-
|
206 |
// ------------------------------------
|
207 |
// OPTIONS PAGE
|
208 |
// ------------------------------------
|
2 |
* Created by jules on 7/17/2015.
|
3 |
*/
|
4 |
|
5 |
+
if (_wpcf7 == null) { var _wpcf7 = wpcf7}; // wpcf7 4.8 fix
|
6 |
+
|
7 |
var old_compose = _wpcf7.taggen.compose;
|
8 |
|
9 |
(function($) {
|
196 |
update_entries();
|
197 |
});
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
// ------------------------------------
|
200 |
// OPTIONS PAGE
|
201 |
// ------------------------------------
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ 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: 4.
|
9 |
-
Stable tag: 1.3.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -97,7 +97,7 @@ Before reaching out to the support forum try to determine which plugin or theme
|
|
97 |
<strong>Reason #2: wp_footer() isn't loaded</strong>
|
98 |
Check if your theme is calling the `wp_footer()` function. Typically this function will be called in your theme's footer.php file.
|
99 |
The conditional fields javascript code is loaded during wp_footer, so a call to this function is crucial. If there is no such call in your theme, go to your theme's footer.php file and add this code right before the closing `</body>` tag:
|
100 |
-
|
101 |
|
102 |
= How do i show fields based on multiple conditions? (AND, OR, NAND, NOR) =
|
103 |
|
@@ -148,6 +148,13 @@ if [b] not equals "2" then show [x-2]`
|
|
148 |
|
149 |
== Changelog ==
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
= 1.3.2 =
|
152 |
* Removed a piece of code that was trying to load a non existing stylesheet
|
153 |
* Updated FAQ
|
5 |
Website: http://bdwm.be
|
6 |
Tags: wordpress, contact form 7, forms, conditional fields
|
7 |
Requires at least: 4.1
|
8 |
+
Tested up to: 4.9
|
9 |
+
Stable tag: 1.3.3
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
97 |
<strong>Reason #2: wp_footer() isn't loaded</strong>
|
98 |
Check if your theme is calling the `wp_footer()` function. Typically this function will be called in your theme's footer.php file.
|
99 |
The conditional fields javascript code is loaded during wp_footer, so a call to this function is crucial. If there is no such call in your theme, go to your theme's footer.php file and add this code right before the closing `</body>` tag:
|
100 |
+
`<?php wp_footer(); ?>`
|
101 |
|
102 |
= How do i show fields based on multiple conditions? (AND, OR, NAND, NOR) =
|
103 |
|
148 |
|
149 |
== Changelog ==
|
150 |
|
151 |
+
= 1.3.3 =
|
152 |
+
* Changes tested with WP 4.7.5 and CF7 4.8
|
153 |
+
* Changed the inner mechanics a bit to make the plugin more edge-case proof and prepare for future ajax support
|
154 |
+
* Fix problems introduced by CF7 4.8 update
|
155 |
+
* Because the CF7 author, Takayuki Miyoshi, decided to get rid of the 'form-pre-serialize' javascript event, the hidden fields containing data about which groups are shown/hidden will now be updated when the form is loaded and each time a form value changes. This might make the plugin slightly slower, but it is the only solution I found so far.
|
156 |
+
* Small bug fix (https://wordpress.org/support/topic/php-depreciated-warning/#post-9151404)
|
157 |
+
|
158 |
= 1.3.2 =
|
159 |
* Removed a piece of code that was trying to load a non existing stylesheet
|
160 |
* Updated FAQ
|
tg_pane_group.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="control-box">
|
2 |
+
<fieldset>
|
3 |
+
<legend><?php echo sprintf( esc_html( $description ) ); ?></legend>
|
4 |
+
|
5 |
+
<table class="form-table">
|
6 |
+
<tbody>
|
7 |
+
|
8 |
+
<tr>
|
9 |
+
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th>
|
10 |
+
<td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
|
11 |
+
</tr>
|
12 |
+
|
13 |
+
</tbody>
|
14 |
+
</table>
|
15 |
+
</fieldset>
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<div class="insert-box">
|
19 |
+
<input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
|
20 |
+
|
21 |
+
<div class="submitbox">
|
22 |
+
<input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<br class="clear" />
|
26 |
+
</div>
|