Version Description
- Removed a piece of code that was trying to load a non existing stylesheet
- Updated FAQ
- Code rearangement and additions for the upcomming Conditional Fields Pro plugin
Download this release
Release Info
Developer | Jules Colle |
Plugin | Conditional Fields for Contact Form 7 |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.2
- admin-style.css +4 -0
- admin.php +4 -2
- cf7cf.php +3 -0
- contact-form-7-conditional-fields.php +2 -2
- js/scripts.js +2 -15
- js/scripts_admin.js +74 -2
- readme.txt +77 -7
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- wpcf7cf-options.php +13 -4
admin-style.css
CHANGED
@@ -31,4 +31,8 @@
|
|
31 |
|
32 |
.wpcf7cf-admin-wrap .option-line input, .wpcf7cf-admin-wrap .option-line select {
|
33 |
width: 100%;
|
|
|
|
|
|
|
|
|
34 |
}
|
31 |
|
32 |
.wpcf7cf-admin-wrap .option-line input, .wpcf7cf-admin-wrap .option-line select {
|
33 |
width: 100%;
|
34 |
+
}
|
35 |
+
|
36 |
+
.ui-autocomplete-term {
|
37 |
+
font-weight: bold;
|
38 |
}
|
admin.php
CHANGED
@@ -6,8 +6,10 @@ function wpcf7cf_admin_enqueue_scripts( $hook_suffix ) {
|
|
6 |
if ( false === strpos( $hook_suffix, 'wpcf7' ) ) {
|
7 |
return; //don't load styles and scripts if this isn't a CF7 page.
|
8 |
}
|
9 |
-
|
10 |
-
wp_enqueue_script('cf7cf-scripts-admin', wpcf7cf_plugin_url( 'js/scripts_admin.js' ),array(), WPCF7CF_VERSION,true);
|
|
|
|
|
11 |
}
|
12 |
|
13 |
add_filter('wpcf7_editor_panels', 'add_conditional_panel');
|
6 |
if ( false === strpos( $hook_suffix, 'wpcf7' ) ) {
|
7 |
return; //don't load styles and scripts if this isn't a CF7 page.
|
8 |
}
|
9 |
+
|
10 |
+
wp_enqueue_script('cf7cf-scripts-admin', wpcf7cf_plugin_url( 'js/scripts_admin.js' ),array('jquery-ui-autocomplete'), WPCF7CF_VERSION,true);
|
11 |
+
wp_localize_script('cf7cf-scripts-admin', 'wpcf7cf_options_0', get_option(WPCF7CF_OPTIONS));
|
12 |
+
|
13 |
}
|
14 |
|
15 |
add_filter('wpcf7_editor_panels', 'add_conditional_panel');
|
cf7cf.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
class ContactForm7ConditionalFields {
|
3 |
private $hidden_fields = array();
|
4 |
private $visible_groups = array();
|
1 |
<?php
|
2 |
+
|
3 |
+
global $wpcf7cf_global_count;
|
4 |
+
|
5 |
class ContactForm7ConditionalFields {
|
6 |
private $hidden_fields = array();
|
7 |
private $visible_groups = array();
|
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 ) );
|
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.2
|
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.2' );
|
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 ) );
|
js/scripts.js
CHANGED
@@ -16,8 +16,6 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
16 |
$(document).ready(function() {
|
17 |
function display_fields(unit_tag, wpcf7cf_conditions, wpcf7cf_settings) {
|
18 |
|
19 |
-
console.log('display fields');
|
20 |
-
|
21 |
//for compatibility with contact-form-7-signature-addon
|
22 |
if (cf7signature_resized == 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) {
|
23 |
for (var i = 0; i < signatures.length; i++) {
|
@@ -122,12 +120,6 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
122 |
var checked_value_index = $.inArray(condition.if_value, checked_values);
|
123 |
var value_index = $.inArray(condition.if_value, all_values);
|
124 |
|
125 |
-
// console.log(all_values);
|
126 |
-
// console.log(checked_values);
|
127 |
-
// console.log(condition);
|
128 |
-
// console.log(value_index);
|
129 |
-
// console.log(checked_value_index);
|
130 |
-
|
131 |
if (
|
132 |
( condition.operator == 'is empty' && checked_values.length == 0 ) ||
|
133 |
( condition.operator == 'not empty' && checked_values.length > 0 )
|
@@ -187,17 +179,12 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
187 |
|
188 |
$('#'+unit_tag+' input, #'+unit_tag+' select, #'+unit_tag+' textarea').on('input paste change',{unit_tag:unit_tag, conditions:conditions, settings:settings}, function(e) {
|
189 |
clearTimeout(timeout);
|
190 |
-
timeout = setTimeout(
|
191 |
});
|
192 |
|
193 |
-
// $('#'+unit_tag+' input:not([type="radio"]):not([type="checkbox"]), #'+unit_tag+' textarea').on('input paste',{unit_tag:unit_tag, conditions:conditions, settings:settings}, function(e) {
|
194 |
-
// clearTimeout(timeout);
|
195 |
-
// timeout = setTimeout(function() { display_fields(e.data.unit_tag, e.data.conditions, e.data.settings) }, 400);
|
196 |
-
// });
|
197 |
-
|
198 |
// bring form in initial state if
|
199 |
$('#'+unit_tag+' form').on('reset', {unit_tag:unit_tag, conditions:conditions, settings:settings}, function(e) {
|
200 |
-
setTimeout(
|
201 |
});
|
202 |
|
203 |
}
|
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++) {
|
120 |
var checked_value_index = $.inArray(condition.if_value, checked_values);
|
121 |
var value_index = $.inArray(condition.if_value, all_values);
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
if (
|
124 |
( condition.operator == 'is empty' && checked_values.length == 0 ) ||
|
125 |
( condition.operator == 'not empty' && checked_values.length > 0 )
|
179 |
|
180 |
$('#'+unit_tag+' input, #'+unit_tag+' select, #'+unit_tag+' textarea').on('input paste change',{unit_tag:unit_tag, conditions:conditions, settings:settings}, function(e) {
|
181 |
clearTimeout(timeout);
|
182 |
+
timeout = setTimeout(display_fields, 100, e.data.unit_tag, e.data.conditions, e.data.settings);
|
183 |
});
|
184 |
|
|
|
|
|
|
|
|
|
|
|
185 |
// bring form in initial state if
|
186 |
$('#'+unit_tag+' form').on('reset', {unit_tag:unit_tag, conditions:conditions, settings:settings}, function(e) {
|
187 |
+
setTimeout(display_fields, 200, e.data.unit_tag, e.data.conditions, e.data.settings);
|
188 |
});
|
189 |
|
190 |
}
|
js/scripts_admin.js
CHANGED
@@ -121,19 +121,92 @@ var old_compose = _wpcf7.taggen.compose;
|
|
121 |
|
122 |
function update_entries() {
|
123 |
$('.if-value').css({'visibility':'visible'});
|
|
|
|
|
124 |
$('.entry').each(function() {
|
125 |
var $entry = $(this);
|
126 |
if ($entry.find('.operator').eq(0).val() == 'is empty' || $entry.find('.operator').eq(0).val() == 'not empty') {
|
127 |
$entry.find('.if-value').eq(0).css({'visibility':'hidden'});
|
|
|
|
|
128 |
}
|
129 |
});
|
130 |
}
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
update_entries();
|
|
|
133 |
$('.operator').change(function() {
|
134 |
update_entries();
|
135 |
});
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
$(document).ready(function() {
|
138 |
|
139 |
$('.wpcf7cf-options-notice .notice-dismiss-2').click(function () {
|
@@ -144,6 +217,7 @@ var old_compose = _wpcf7.taggen.compose;
|
|
144 |
});
|
145 |
|
146 |
function wpcf7cf_dismiss_notice() {
|
|
|
147 |
$.post(ajaxurl, {action:'wpcf7cf_dismiss_notice'}, function(response) {
|
148 |
// nothing to do. dismiss_notice option should be set to TRUE server side by now.
|
149 |
});
|
@@ -151,6 +225,4 @@ var old_compose = _wpcf7.taggen.compose;
|
|
151 |
|
152 |
});
|
153 |
|
154 |
-
|
155 |
-
|
156 |
})( jQuery );
|
121 |
|
122 |
function update_entries() {
|
123 |
$('.if-value').css({'visibility':'visible'});
|
124 |
+
$('.if-value').autocomplete( "disable" );
|
125 |
+
|
126 |
$('.entry').each(function() {
|
127 |
var $entry = $(this);
|
128 |
if ($entry.find('.operator').eq(0).val() == 'is empty' || $entry.find('.operator').eq(0).val() == 'not empty') {
|
129 |
$entry.find('.if-value').eq(0).css({'visibility':'hidden'});
|
130 |
+
} else if ($entry.find('.operator').eq(0).val().endsWith('(regex)')) {
|
131 |
+
$entry.find('.if-value').eq(0).autocomplete( "enable" );
|
132 |
}
|
133 |
});
|
134 |
}
|
135 |
|
136 |
+
var regexes = [
|
137 |
+
{ label: wpcf7cf_options_0.regex_email_label, desc: wpcf7cf_options_0.regex_email },
|
138 |
+
{ label: wpcf7cf_options_0.regex_numeric_label, desc: wpcf7cf_options_0.regex_numeric },
|
139 |
+
{ label: wpcf7cf_options_0.regex_alphanumeric_label, desc: wpcf7cf_options_0.regex_alphanumeric },
|
140 |
+
{ label: wpcf7cf_options_0.regex_alphabetic_label, desc: wpcf7cf_options_0.regex_alphabetic },
|
141 |
+
{ label: wpcf7cf_options_0.regex_date_label, desc: wpcf7cf_options_0.regex_date },
|
142 |
+
{ label: wpcf7cf_options_0.regex_custom_1_label, desc: wpcf7cf_options_0.regex_custom_1 },
|
143 |
+
{ label: wpcf7cf_options_0.regex_custom_2_label, desc: wpcf7cf_options_0.regex_custom_2 },
|
144 |
+
{ label: wpcf7cf_options_0.regex_custom_3_label, desc: wpcf7cf_options_0.regex_custom_3 },
|
145 |
+
{ label: wpcf7cf_options_0.regex_custom_4_label, desc: wpcf7cf_options_0.regex_custom_4 },
|
146 |
+
{ label: wpcf7cf_options_0.regex_custom_5_label, desc: wpcf7cf_options_0.regex_custom_5 },
|
147 |
+
];
|
148 |
+
|
149 |
+
var i = regexes.length;
|
150 |
+
while (i--) {
|
151 |
+
if (null == regexes[i].label || null == regexes[i].desc || regexes[i].label == '' || regexes[i].desc == '') {
|
152 |
+
regexes.splice(i,1);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
157 |
+
|
158 |
+
$('.if-value').autocomplete({
|
159 |
+
disabled: true,
|
160 |
+
source: function(request, response) {
|
161 |
+
var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
|
162 |
+
response($.grep(regexes, function(value) {
|
163 |
+
return matcher.test(value.label || value.value || value) || matcher.test(value.desc);
|
164 |
+
}));
|
165 |
+
},
|
166 |
+
focus: function( event, ui ) {
|
167 |
+
$( event.target ).val( ui.item.desc );
|
168 |
+
return false;
|
169 |
+
},
|
170 |
+
select: function( event, ui ) {
|
171 |
+
$( event.target ).val( ui.item.desc );
|
172 |
+
return false;
|
173 |
+
},
|
174 |
+
open: function(e,ui) {
|
175 |
+
$el = $(e.target);
|
176 |
+
var styledTerm = termTemplate.replace('%s', $el.val());
|
177 |
+
|
178 |
+
$('.ui-autocomplete').find('em').each(function() {
|
179 |
+
var me = $(this);
|
180 |
+
me.html( me.text().replace($el.val(), styledTerm) );
|
181 |
+
});
|
182 |
+
}
|
183 |
+
}).each(function() {
|
184 |
+
$(this).autocomplete( "instance" )._renderItem = function( ul, item ) {
|
185 |
+
return $("<li>")
|
186 |
+
.append("<div><em>" + item.label + "</em><br><em>" + item.desc + "</em></div>")
|
187 |
+
.appendTo(ul);
|
188 |
+
}
|
189 |
+
});
|
190 |
+
|
191 |
update_entries();
|
192 |
+
|
193 |
$('.operator').change(function() {
|
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 |
+
// ------------------------------------
|
209 |
+
|
210 |
$(document).ready(function() {
|
211 |
|
212 |
$('.wpcf7cf-options-notice .notice-dismiss-2').click(function () {
|
217 |
});
|
218 |
|
219 |
function wpcf7cf_dismiss_notice() {
|
220 |
+
$('input[name="wpcf7cf_options[notice_dismissed]"]').val('true');
|
221 |
$.post(ajaxurl, {action:'wpcf7cf_dismiss_notice'}, function(response) {
|
222 |
// nothing to do. dismiss_notice option should be set to TRUE server side by now.
|
223 |
});
|
225 |
|
226 |
});
|
227 |
|
|
|
|
|
228 |
})( jQuery );
|
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: 4.7.4
|
9 |
-
Stable tag: 1.3.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -62,19 +62,84 @@ Example email:
|
|
62 |
|
63 |
Advanced users can now code up the conditions as plain text instead of using the select boxes, using the import/export feature.
|
64 |
|
65 |
-
|
66 |
== Installation ==
|
67 |
|
68 |
Please follow the [standard installation procedure for WordPress plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
|
69 |
|
|
|
|
|
70 |
== Frequently Asked Questions ==
|
71 |
|
72 |
-
=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
== Screenshots ==
|
80 |
|
@@ -83,6 +148,11 @@ I will assume that you successfully installed both plugins, that you were able t
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
86 |
= 1.3.1 =
|
87 |
* Fixed bug in 1.3 that broke everything
|
88 |
|
@@ -106,7 +176,7 @@ I will assume that you successfully installed both plugins, that you were able t
|
|
106 |
= 1.2 =
|
107 |
* Made compatible with <a href="https://wordpress.org/plugins/contact-form-7-multi-step-module/">Contact Form 7 Multi-Step Forms</a>
|
108 |
* Small bug fix by Manual from advantia.net: now only considering fields which are strictly inside hidden group tags with form submit. Important in some edge cases where form elements get hidden by other mechanisms, i.e. tabbed forms.
|
109 |
-
* Started work on
|
110 |
* Removed some debug code
|
111 |
* Updated readme file
|
112 |
|
6 |
Tags: wordpress, contact form 7, forms, conditional fields
|
7 |
Requires at least: 4.1
|
8 |
Tested up to: 4.7.4
|
9 |
+
Stable tag: 1.3.2
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
62 |
|
63 |
Advanced users can now code up the conditions as plain text instead of using the select boxes, using the import/export feature.
|
64 |
|
|
|
65 |
== Installation ==
|
66 |
|
67 |
Please follow the [standard installation procedure for WordPress plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
|
68 |
|
69 |
+
Follow [this tutorial](http://bdwm.be/wpcf7cf/how-to-set-up-conditional-fields-for-contact-form-7/) if you are not sure how to use the plugin.
|
70 |
+
|
71 |
== Frequently Asked Questions ==
|
72 |
|
73 |
+
= Email message is not showing the correct values =
|
74 |
+
|
75 |
+
<strong>All field names should be unique</strong>
|
76 |
+
|
77 |
+
Even though your fields might never show up at the same time, it is still important to realize that WPCF7CF will not remove the fields, it merely hides them. So all fields will be submitted when the form is sent. Because of this no two fields can have the same name.
|
78 |
+
|
79 |
+
Incorrect form (2 input elements having the same name "a"):
|
80 |
+
`
|
81 |
+
[group group-1][select a "1" "2" "3"][/group]
|
82 |
+
[group group-2][select a "1" "2" "3"][/group]
|
83 |
+
`
|
84 |
+
|
85 |
+
Correct form (all groups and fields have unique names):
|
86 |
+
`
|
87 |
+
[group group-1][select a "1" "2" "3"][/group]
|
88 |
+
[group group-2][select b "1" "2" "3"][/group]
|
89 |
+
`
|
90 |
+
|
91 |
+
= All my groups show up all the time and never get hidden. =
|
92 |
+
|
93 |
+
<strong>Reason #1: Javascript error</strong>
|
94 |
+
Check your browser console (F12) for any javascript errors. WPCF7CF loads it's scripts at the bottom of the HTML page, so if some javascript error gets triggered before that, the code will not be executed in most browsers.
|
95 |
+
Before reaching out to the support forum try to determine which plugin or theme is causing the problem, by gradually disabling plugins and changing theme.
|
96 |
+
|
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 |
+
|
104 |
+
<strong>if a=1 AND b=2 then, show [group x]</strong>
|
105 |
|
106 |
+
You will need to create nested groups for the number of conditions, so your form might look like this:
|
107 |
|
108 |
+
`[select a "1" "2" "3"]
|
109 |
+
[select b "1" "2" "3"]
|
110 |
+
[group x-1][group x-2]TADA![/group][/group]`
|
111 |
+
|
112 |
+
and use these conditions
|
113 |
+
|
114 |
+
`if [a] equals "1" then show [x-1]
|
115 |
+
if [b] equals "2" then show [x-2]`
|
116 |
+
|
117 |
+
<strong>if a=1 OR b=2 then, show [group x]</strong>
|
118 |
+
|
119 |
+
This is more straightforward, as OR conditions are assumed. Giving this form:
|
120 |
+
|
121 |
+
`[select a "1" "2" "3"]
|
122 |
+
[select b "1" "2" "3"]
|
123 |
+
[group x]TADA![/group]`
|
124 |
+
|
125 |
+
You can simply use these conditions:
|
126 |
+
|
127 |
+
`if [a] equals "1" then show [x]
|
128 |
+
if [b] equals "2" then show [x]`
|
129 |
+
|
130 |
+
<strong>if a=1 NAND b=2 then, show [group x]</strong>
|
131 |
+
|
132 |
+
Same form as OR, but just use "not equals" instead of "equals":
|
133 |
+
|
134 |
+
`if [a] not equals "1" then show [x]
|
135 |
+
if [b] not equals "2" then show [x]`
|
136 |
+
|
137 |
+
<strong>if a=1 NOR b=2 then, show [group x]</strong>
|
138 |
+
|
139 |
+
Same form as AND, but just use "not equals" instead of "equals":
|
140 |
+
|
141 |
+
`if [a] not equals "1" then show [x-1]
|
142 |
+
if [b] not equals "2" then show [x-2]`
|
143 |
|
144 |
== Screenshots ==
|
145 |
|
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
|
154 |
+
* Code rearangement and additions for the upcomming Conditional Fields Pro plugin
|
155 |
+
|
156 |
= 1.3.1 =
|
157 |
* Fixed bug in 1.3 that broke everything
|
158 |
|
176 |
= 1.2 =
|
177 |
* Made compatible with <a href="https://wordpress.org/plugins/contact-form-7-multi-step-module/">Contact Form 7 Multi-Step Forms</a>
|
178 |
* Small bug fix by Manual from advantia.net: now only considering fields which are strictly inside hidden group tags with form submit. Important in some edge cases where form elements get hidden by other mechanisms, i.e. tabbed forms.
|
179 |
+
* Started work on WPCF7CF Pro, made some structural code modifications so the free plugin can function as the base for both plugins.
|
180 |
* Removed some debug code
|
181 |
* Updated readme file
|
182 |
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
wpcf7cf-options.php
CHANGED
@@ -19,6 +19,7 @@ $wpcf7cf_default_options = array(
|
|
19 |
$wpcf7cf_default_options = apply_filters('wpcf7cf_default_options', $wpcf7cf_default_options);
|
20 |
|
21 |
$wpcf7cf_options = get_option(WPCF7CF_OPTIONS);
|
|
|
22 |
if (!is_array($wpcf7cf_options)) $wpcf7cf_options = array();
|
23 |
|
24 |
if(isset($_POST['reset'])) {
|
@@ -42,7 +43,7 @@ function wpcf7cf_wrap_input_field_after() { echo '</div>'; }
|
|
42 |
|
43 |
add_action( 'admin_enqueue_scripts', 'wpcf7cf_load_page_options_wp_admin_style' );
|
44 |
function wpcf7cf_load_page_options_wp_admin_style() {
|
45 |
-
wp_register_style( 'page_options_wp_admin_css', plugins_url('
|
46 |
wp_enqueue_style( 'page_options_wp_admin_css' );
|
47 |
}
|
48 |
|
@@ -86,6 +87,8 @@ function wpcf7cf_options_page() {
|
|
86 |
<?php settings_fields(WPCF7CF_OPTIONS); ?>
|
87 |
|
88 |
<input type="hidden" value="1" id="wpcf7cf_settings_saved" name="<?php echo WPCF7CF_OPTIONS.'[wpcf7cf_settings_saved]' ?>">
|
|
|
|
|
89 |
|
90 |
<h3>Default animation Settings</h3>
|
91 |
|
@@ -195,21 +198,27 @@ function wpcf7cf_input_field($slug, $args) {
|
|
195 |
$defaults = array(
|
196 |
'label'=>'',
|
197 |
'desription' => '',
|
198 |
-
'default' => $wpcf7cf_default_options[$slug]
|
|
|
199 |
);
|
200 |
|
201 |
$args = wp_parse_args( $args, $defaults );
|
202 |
extract($args);
|
203 |
|
204 |
-
$label; $description; $default;
|
205 |
|
206 |
if (!key_exists($slug, $wpcf7cf_options)) {
|
207 |
$wpcf7cf_options[$slug] = $default;
|
|
|
208 |
}
|
209 |
|
210 |
?>
|
211 |
<div class="option-line">
|
212 |
-
|
|
|
|
|
|
|
|
|
213 |
<span class="field"><input type="text" data-default-value="<?php echo $default ?>" value="<?php echo $wpcf7cf_options[$slug] ?>" id="<?php echo WPCF7CF_OPTIONS.'_'.$slug ?>" name="<?php echo WPCF7CF_OPTIONS.'['.$slug.']' ?>"></span>
|
214 |
<span class="description"><?php echo $description ?><?php if (!empty($default)) echo ' (Default: '.$default.')' ?></span>
|
215 |
</div>
|
19 |
$wpcf7cf_default_options = apply_filters('wpcf7cf_default_options', $wpcf7cf_default_options);
|
20 |
|
21 |
$wpcf7cf_options = get_option(WPCF7CF_OPTIONS);
|
22 |
+
|
23 |
if (!is_array($wpcf7cf_options)) $wpcf7cf_options = array();
|
24 |
|
25 |
if(isset($_POST['reset'])) {
|
43 |
|
44 |
add_action( 'admin_enqueue_scripts', 'wpcf7cf_load_page_options_wp_admin_style' );
|
45 |
function wpcf7cf_load_page_options_wp_admin_style() {
|
46 |
+
wp_register_style( 'page_options_wp_admin_css', plugins_url('admin-style.css',__FILE__), false, WPCF7CF_VERSION );
|
47 |
wp_enqueue_style( 'page_options_wp_admin_css' );
|
48 |
}
|
49 |
|
87 |
<?php settings_fields(WPCF7CF_OPTIONS); ?>
|
88 |
|
89 |
<input type="hidden" value="1" id="wpcf7cf_settings_saved" name="<?php echo WPCF7CF_OPTIONS.'[wpcf7cf_settings_saved]' ?>">
|
90 |
+
<input type="hidden" name="<?php echo WPCF7CF_OPTIONS.'[notice_dismissed]' ?>" value="<?php echo $wpcf7cf_options['notice_dismissed'] ?>" />
|
91 |
+
|
92 |
|
93 |
<h3>Default animation Settings</h3>
|
94 |
|
198 |
$defaults = array(
|
199 |
'label'=>'',
|
200 |
'desription' => '',
|
201 |
+
'default' => $wpcf7cf_default_options[$slug],
|
202 |
+
'label_editable' => false
|
203 |
);
|
204 |
|
205 |
$args = wp_parse_args( $args, $defaults );
|
206 |
extract($args);
|
207 |
|
208 |
+
$label; $description; $default; $label_editable;
|
209 |
|
210 |
if (!key_exists($slug, $wpcf7cf_options)) {
|
211 |
$wpcf7cf_options[$slug] = $default;
|
212 |
+
$wpcf7cf_options[$slug.'_label'] = $label;
|
213 |
}
|
214 |
|
215 |
?>
|
216 |
<div class="option-line">
|
217 |
+
<?php if ($label_editable) { ?>
|
218 |
+
<span class="label"><input type="text" data-default-value="<?php echo $label ?>" value="<?php echo $wpcf7cf_options[$slug.'_label'] ?>" id="<?php echo WPCF7CF_OPTIONS.'_'.$slug.'_label' ?>" name="<?php echo WPCF7CF_OPTIONS.'['.$slug.'_label]' ?>"></span>
|
219 |
+
<?php } else { ?>
|
220 |
+
<span class="label"><?php echo $label ?></span>
|
221 |
+
<?php } ?>
|
222 |
<span class="field"><input type="text" data-default-value="<?php echo $default ?>" value="<?php echo $wpcf7cf_options[$slug] ?>" id="<?php echo WPCF7CF_OPTIONS.'_'.$slug ?>" name="<?php echo WPCF7CF_OPTIONS.'['.$slug.']' ?>"></span>
|
223 |
<span class="description"><?php echo $description ?><?php if (!empty($default)) echo ' (Default: '.$default.')' ?></span>
|
224 |
</div>
|