Version Description
(08-21-18) = * Fixed some CSS issues (https://wordpress.org/support/topic/crash-view-admin-the-list-of-posts-entry/) * Dropped support for PHP version 5.2, now PHP 5.3+ is required to run the plugin. Let's push things forward! * Added conditional group support to mail attachments field (https://github.com/pwkip/contact-form-7-conditional-fields/issues/22) * Added repeater field to PRO version.
Download this release
Release Info
Developer | Jules Colle |
Plugin | Conditional Fields for Contact Form 7 |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.4.1
- admin-style.css +107 -164
- admin-style.css.map +7 -0
- admin-style.scss +216 -0
- admin.php +1 -1
- cf7cf.php +8 -22
- contact-form-7-conditional-fields.php +1 -1
- init.php +4 -1
- js/scripts.js +50 -9
- js/scripts_admin.js +11 -9
- readme.txt +15 -8
- wpcf7cf-options.php +1 -1
admin-style.css
CHANGED
@@ -1,214 +1,157 @@
|
|
1 |
-
#wpcf7cf-new-entry {
|
2 |
-
|
3 |
-
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
padding: 10px;
|
7 |
display: inline-block;
|
8 |
vertical-align: middle;
|
9 |
-
width: 10%;
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
}
|
14 |
-
.wpcf7cf-admin-wrap .description {
|
15 |
width: 40%;
|
16 |
-
vertical-align: top;
|
17 |
-
|
18 |
-
}
|
19 |
-
|
20 |
-
.wpcf7cf-admin-wrap .option-line {
|
21 |
border-bottom: 1px solid #dddddd;
|
22 |
background-color: #f9f9f9;
|
23 |
-
padding: 0 10px;
|
24 |
-
|
25 |
-
|
26 |
-
.wpcf7cf-admin-wrap .option-line
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
.ui-autocomplete-term {
|
35 |
-
font-weight: bold;
|
36 |
-
}
|
37 |
-
|
38 |
-
.wpcf7cf-admin-wrap .option-line > .label.editable {
|
39 |
-
position: relative;
|
40 |
-
}
|
41 |
-
|
42 |
-
.wpcf7cf-admin-wrap .option-line > .label.editable input {
|
43 |
background-color: transparent;
|
44 |
border-width: 0;
|
45 |
outline: none;
|
46 |
box-shadow: none;
|
47 |
-
padding: 0;
|
48 |
-
|
49 |
-
|
50 |
-
.wpcf7cf-admin-wrap .option-line > .label.editable input:after {
|
51 |
content: "edit";
|
52 |
display: block;
|
53 |
width: 10px;
|
54 |
-
right:0;
|
55 |
-
position: absolute;
|
56 |
-
|
57 |
-
|
58 |
-
.wpcf7cf-admin-wrap .option-line > .label.editable input:focus {
|
59 |
background: #fff;
|
60 |
-
box-shadow: inset 0 1px 2px rgba(0,0,0
|
61 |
border: 1px solid #ddd;
|
62 |
-
padding: 2px;
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
.wpcf7cf-and {
|
70 |
display: inline-block;
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
display: inline-block;
|
75 |
-
vertical-align: top;
|
76 |
-
}
|
77 |
-
|
78 |
-
#wpcf7cf-entries input, #wpcf7cf-entries select, .and-button, .delete-button, #wpcf7cf-entries .if-txt, #wpcf7cf-entries .label, #wpcf7cf-add-button {
|
79 |
-
position:relative;
|
80 |
display: inline-block;
|
81 |
vertical-align: bottom;
|
82 |
-
margin:2px;
|
83 |
padding: 3px;
|
84 |
background: #fefefe;
|
85 |
border: 1px solid #bababa;
|
86 |
box-shadow: none;
|
87 |
height: 22px;
|
88 |
line-height: 22px;
|
89 |
-
box-sizing: content-box;
|
90 |
-
|
91 |
-
|
92 |
-
#wpcf7cf-entries .label {
|
93 |
background-color: transparent;
|
94 |
-
border: none;
|
95 |
-
|
96 |
-
|
97 |
-
.and-button, .delete-button, #wpcf7cf-add-button {
|
98 |
border: 1px solid #4ed521;
|
99 |
color: #007b04;
|
100 |
cursor: pointer;
|
101 |
font-size: 11px;
|
102 |
font-weight: bold;
|
103 |
-
-webkit-touch-callout: none;
|
104 |
-
|
105 |
-
-
|
106 |
-
|
107 |
-
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
113 |
margin-top: 10px;
|
114 |
text-align: center;
|
115 |
padding-left: 20px;
|
116 |
-
padding-right:20px;
|
117 |
-
|
118 |
-
|
119 |
-
.
|
120 |
-
background-color: rgba(75, 169, 61, 0.2);
|
121 |
-
}
|
122 |
-
|
123 |
-
.delete-button {
|
124 |
border: 1px solid #bababa;
|
125 |
color: #858585;
|
126 |
background-color: transparent;
|
127 |
-
margin-left: 42px;
|
128 |
-
|
129 |
-
|
130 |
-
.
|
131 |
-
|
132 |
-
|
133 |
-
}
|
134 |
-
|
135 |
-
.and-button {
|
136 |
-
display:none;
|
137 |
width: 30px;
|
138 |
-
text-align: center;
|
139 |
-
|
140 |
-
.wpcf7cf-and-rule:first-child .and-button {
|
141 |
display: inline-block;
|
142 |
vertical-align: top;
|
143 |
height: 22px;
|
144 |
position: absolute;
|
145 |
line-height: 22px;
|
146 |
right: 50px;
|
147 |
-
top: 0;
|
148 |
-
|
149 |
-
|
150 |
-
.wpcf7cf-and-rule {
|
151 |
margin-bottom: 4px;
|
152 |
-
height: 30px;
|
153 |
-
|
154 |
-
|
155 |
-
.wpcf7cf-and-rule .if-txt
|
156 |
-
cursor: n-resize;
|
157 |
-
}
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
.wpcf7cf-and-rule .if-txt:before {
|
162 |
content: 'and';
|
163 |
position: absolute;
|
164 |
width: 30px;
|
165 |
text-align: right;
|
166 |
-
left: -34px;
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
#contitional-panel {
|
174 |
-
overflow-x: auto;
|
175 |
-
}
|
176 |
-
|
177 |
-
.wpcf7cf-inner-container {
|
178 |
-
min-width: 800px;
|
179 |
-
}
|
180 |
-
|
181 |
-
.entry {
|
182 |
box-sizing: border-box;
|
183 |
-
display:flex;
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
width:
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
width: 14px;
|
204 |
-
text-align: center;
|
205 |
-
}
|
206 |
-
|
207 |
-
.operator {
|
208 |
-
/*width:140px;*/
|
209 |
-
}
|
210 |
-
|
211 |
-
.if-value {
|
212 |
-
flex:1;
|
213 |
-
margin-right:3px !important;
|
214 |
-
}
|
1 |
+
#wpcf7cf-new-entry {
|
2 |
+
display: inline-block;
|
3 |
+
display: none; }
|
4 |
|
5 |
+
#wpcf7cf-delete-button {
|
6 |
+
display: none; }
|
7 |
+
|
8 |
+
#wpcf7cf-settings-text {
|
9 |
+
width: 100%;
|
10 |
+
height: 280px;
|
11 |
+
font-family: "Courier New", Courier, monospace; }
|
12 |
+
|
13 |
+
#wpcf7cf-conditional-panel {
|
14 |
+
overflow-x: auto; }
|
15 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .label, #wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .field, #wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .description {
|
16 |
padding: 10px;
|
17 |
display: inline-block;
|
18 |
vertical-align: middle;
|
19 |
+
width: 10%; }
|
20 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .field {
|
21 |
+
width: 20%; }
|
22 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .description {
|
|
|
|
|
23 |
width: 40%;
|
24 |
+
vertical-align: top; }
|
25 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line {
|
|
|
|
|
|
|
26 |
border-bottom: 1px solid #dddddd;
|
27 |
background-color: #f9f9f9;
|
28 |
+
padding: 0 10px; }
|
29 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line:nth-child(2n) {
|
30 |
+
background-color: #e9e9e9; }
|
31 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line input, #wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line select {
|
32 |
+
width: 100%; }
|
33 |
+
#wpcf7cf-conditional-panel .ui-autocomplete-term {
|
34 |
+
font-weight: bold; }
|
35 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line > .label.editable {
|
36 |
+
position: relative; }
|
37 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line > .label.editable input {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
background-color: transparent;
|
39 |
border-width: 0;
|
40 |
outline: none;
|
41 |
box-shadow: none;
|
42 |
+
padding: 0; }
|
43 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line > .label.editable input:after {
|
|
|
|
|
44 |
content: "edit";
|
45 |
display: block;
|
46 |
width: 10px;
|
47 |
+
right: 0;
|
48 |
+
position: absolute; }
|
49 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line > .label.editable input:focus {
|
|
|
|
|
50 |
background: #fff;
|
51 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
52 |
border: 1px solid #ddd;
|
53 |
+
padding: 2px; }
|
54 |
+
#wpcf7cf-conditional-panel .wpcf7cf-admin-wrap .option-line > .label.editable input:focus:after {
|
55 |
+
content: ""; }
|
56 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and {
|
57 |
+
display: inline-block; }
|
58 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rules, #wpcf7cf-conditional-panel .wpcf7cf-if {
|
|
|
|
|
59 |
display: inline-block;
|
60 |
+
vertical-align: top; }
|
61 |
+
#wpcf7cf-conditional-panel #wpcf7cf-entries input, #wpcf7cf-conditional-panel #wpcf7cf-entries select, #wpcf7cf-conditional-panel .and-button, #wpcf7cf-conditional-panel .delete-button, #wpcf7cf-conditional-panel #wpcf7cf-entries .if-txt, #wpcf7cf-conditional-panel #wpcf7cf-entries .label, #wpcf7cf-conditional-panel #wpcf7cf-add-button {
|
62 |
+
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
display: inline-block;
|
64 |
vertical-align: bottom;
|
65 |
+
margin: 2px;
|
66 |
padding: 3px;
|
67 |
background: #fefefe;
|
68 |
border: 1px solid #bababa;
|
69 |
box-shadow: none;
|
70 |
height: 22px;
|
71 |
line-height: 22px;
|
72 |
+
box-sizing: content-box; }
|
73 |
+
#wpcf7cf-conditional-panel #wpcf7cf-entries .label {
|
|
|
|
|
74 |
background-color: transparent;
|
75 |
+
border: none; }
|
76 |
+
#wpcf7cf-conditional-panel .and-button, #wpcf7cf-conditional-panel .delete-button, #wpcf7cf-conditional-panel #wpcf7cf-add-button {
|
|
|
|
|
77 |
border: 1px solid #4ed521;
|
78 |
color: #007b04;
|
79 |
cursor: pointer;
|
80 |
font-size: 11px;
|
81 |
font-weight: bold;
|
82 |
+
-webkit-touch-callout: none;
|
83 |
+
/* iOS Safari */
|
84 |
+
-webkit-user-select: none;
|
85 |
+
/* Safari */
|
86 |
+
-khtml-user-select: none;
|
87 |
+
/* Konqueror HTML */
|
88 |
+
-moz-user-select: none;
|
89 |
+
/* Firefox */
|
90 |
+
-ms-user-select: none;
|
91 |
+
/* Internet Explorer/Edge */
|
92 |
+
user-select: none;
|
93 |
+
/* Non-prefixed version, currently */
|
94 |
+
background-color: rgba(75, 169, 61, 0.11); }
|
95 |
+
#wpcf7cf-conditional-panel #wpcf7cf-add-button {
|
96 |
margin-top: 10px;
|
97 |
text-align: center;
|
98 |
padding-left: 20px;
|
99 |
+
padding-right: 20px; }
|
100 |
+
#wpcf7cf-conditional-panel .and-button:hover {
|
101 |
+
background-color: rgba(75, 169, 61, 0.2); }
|
102 |
+
#wpcf7cf-conditional-panel .delete-button {
|
|
|
|
|
|
|
|
|
103 |
border: 1px solid #bababa;
|
104 |
color: #858585;
|
105 |
background-color: transparent;
|
106 |
+
margin-left: 42px; }
|
107 |
+
#wpcf7cf-conditional-panel .delete-button:hover {
|
108 |
+
background-color: rgba(133, 133, 133, 0.11); }
|
109 |
+
#wpcf7cf-conditional-panel .and-button {
|
110 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
111 |
width: 30px;
|
112 |
+
text-align: center; }
|
113 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule:first-child .and-button {
|
|
|
114 |
display: inline-block;
|
115 |
vertical-align: top;
|
116 |
height: 22px;
|
117 |
position: absolute;
|
118 |
line-height: 22px;
|
119 |
right: 50px;
|
120 |
+
top: 0; }
|
121 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule {
|
|
|
|
|
122 |
margin-bottom: 4px;
|
123 |
+
height: 30px; }
|
124 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule .if-txt, #wpcf7cf-conditional-panel .wpcf7cf-if > .label {
|
125 |
+
cursor: n-resize; }
|
126 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule .if-txt:before {
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
content: 'and';
|
128 |
position: absolute;
|
129 |
width: 30px;
|
130 |
text-align: right;
|
131 |
+
left: -34px; }
|
132 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule:first-child .if-txt:before {
|
133 |
+
display: none; }
|
134 |
+
#wpcf7cf-conditional-panel .wpcf7cf-inner-container {
|
135 |
+
min-width: 800px; }
|
136 |
+
#wpcf7cf-conditional-panel .entry {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
box-sizing: border-box;
|
138 |
+
display: flex; }
|
139 |
+
#wpcf7cf-conditional-panel .entry .wpcf7cf-if {
|
140 |
+
width: 188px; }
|
141 |
+
#wpcf7cf-conditional-panel .then-field-select {
|
142 |
+
width: 130px; }
|
143 |
+
#wpcf7cf-conditional-panel .entry .wpcf7cf-and-rules {
|
144 |
+
flex: 1;
|
145 |
+
position: relative; }
|
146 |
+
#wpcf7cf-conditional-panel .wpcf7cf-and-rule {
|
147 |
+
display: flex; }
|
148 |
+
#wpcf7cf-conditional-panel .if-txt {
|
149 |
+
width: 14px;
|
150 |
+
text-align: center; }
|
151 |
+
#wpcf7cf-conditional-panel .operator {
|
152 |
+
/*width:140px;*/ }
|
153 |
+
#wpcf7cf-conditional-panel .if-value {
|
154 |
+
flex: 1;
|
155 |
+
margin-right: 3px !important; }
|
156 |
+
|
157 |
+
/*# sourceMappingURL=admin-style.css.map */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin-style.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": "AAAA,kBAAmB;EAAE,OAAO,EAAE,YAAY;EAAE,OAAO,EAAC,IAAI;;AACxD,sBAAuB;EAAE,OAAO,EAAE,IAAI;;AACtC,sBAAuB;EAAE,KAAK,EAAE,IAAI;EAAE,MAAM,EAAE,KAAK;EAAE,WAAW,EAAE,iCAAiC;;AAEnG,0BAA2B;EAoHvB,UAAU,EAAE,IAAI;EAlHhB,yKAAyF;IACrF,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,YAAY;IACrB,cAAc,EAAE,MAAM;IACtB,KAAK,EAAE,GAAG;EAEd,qDAA2B;IACvB,KAAK,EAAE,GAAG;EAEd,2DAAiC;IAC7B,KAAK,EAAE,GAAG;IACV,cAAc,EAAE,GAAG;EAIvB,2DAAiC;IAC7B,aAAa,EAAE,iBAAiB;IAChC,gBAAgB,EAAE,OAAO;IACzB,OAAO,EAAE,MAAM;EAGnB,yEAA+C;IAC3C,gBAAgB,EAAE,OAAO;EAG7B,qIAAgF;IAC5E,KAAK,EAAE,IAAI;EAGf,gDAAsB;IAClB,WAAW,EAAE,IAAI;EAGrB,6EAAmD;IAC/C,QAAQ,EAAE,QAAQ;EAGtB,mFAAyD;IACrD,gBAAgB,EAAE,WAAW;IAC7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 |
+
#wpcf7cf-new-entry { display: inline-block; display:none; }
|
2 |
+
#wpcf7cf-delete-button { display: none; }
|
3 |
+
#wpcf7cf-settings-text { width: 100%; height: 280px; font-family: "Courier New", Courier, monospace; }
|
4 |
+
|
5 |
+
#wpcf7cf-conditional-panel {
|
6 |
+
|
7 |
+
.wpcf7cf-admin-wrap .label, .wpcf7cf-admin-wrap .field, .wpcf7cf-admin-wrap .description {
|
8 |
+
padding: 10px;
|
9 |
+
display: inline-block;
|
10 |
+
vertical-align: middle;
|
11 |
+
width: 10%;
|
12 |
+
}
|
13 |
+
.wpcf7cf-admin-wrap .field {
|
14 |
+
width: 20%;
|
15 |
+
}
|
16 |
+
.wpcf7cf-admin-wrap .description {
|
17 |
+
width: 40%;
|
18 |
+
vertical-align: top;
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
.wpcf7cf-admin-wrap .option-line {
|
23 |
+
border-bottom: 1px solid #dddddd;
|
24 |
+
background-color: #f9f9f9;
|
25 |
+
padding: 0 10px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wpcf7cf-admin-wrap .option-line:nth-child(2n) {
|
29 |
+
background-color: #e9e9e9;
|
30 |
+
}
|
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 |
+
}
|
39 |
+
|
40 |
+
.wpcf7cf-admin-wrap .option-line > .label.editable {
|
41 |
+
position: relative;
|
42 |
+
}
|
43 |
+
|
44 |
+
.wpcf7cf-admin-wrap .option-line > .label.editable input {
|
45 |
+
background-color: transparent;
|
46 |
+
border-width: 0;
|
47 |
+
outline: none;
|
48 |
+
box-shadow: none;
|
49 |
+
padding: 0;
|
50 |
+
}
|
51 |
+
|
52 |
+
.wpcf7cf-admin-wrap .option-line > .label.editable input:after {
|
53 |
+
content: "edit";
|
54 |
+
display: block;
|
55 |
+
width: 10px;
|
56 |
+
right:0;
|
57 |
+
position: absolute;
|
58 |
+
}
|
59 |
+
|
60 |
+
.wpcf7cf-admin-wrap .option-line > .label.editable input:focus {
|
61 |
+
background: #fff;
|
62 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,.07) ;
|
63 |
+
border: 1px solid #ddd;
|
64 |
+
padding: 2px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.wpcf7cf-admin-wrap .option-line > .label.editable input:focus:after {
|
68 |
+
content: "";
|
69 |
+
}
|
70 |
+
|
71 |
+
.wpcf7cf-and {
|
72 |
+
display: inline-block;
|
73 |
+
}
|
74 |
+
|
75 |
+
.wpcf7cf-and-rules, .wpcf7cf-if {
|
76 |
+
display: inline-block;
|
77 |
+
vertical-align: top;
|
78 |
+
}
|
79 |
+
|
80 |
+
#wpcf7cf-entries input, #wpcf7cf-entries select, .and-button, .delete-button, #wpcf7cf-entries .if-txt, #wpcf7cf-entries .label, #wpcf7cf-add-button {
|
81 |
+
position:relative;
|
82 |
+
display: inline-block;
|
83 |
+
vertical-align: bottom;
|
84 |
+
margin:2px;
|
85 |
+
padding: 3px;
|
86 |
+
background: #fefefe;
|
87 |
+
border: 1px solid #bababa;
|
88 |
+
box-shadow: none;
|
89 |
+
height: 22px;
|
90 |
+
line-height: 22px;
|
91 |
+
box-sizing: content-box;
|
92 |
+
}
|
93 |
+
|
94 |
+
#wpcf7cf-entries .label {
|
95 |
+
background-color: transparent;
|
96 |
+
border: none;
|
97 |
+
}
|
98 |
+
|
99 |
+
.and-button, .delete-button, #wpcf7cf-add-button {
|
100 |
+
border: 1px solid #4ed521;
|
101 |
+
color: #007b04;
|
102 |
+
cursor: pointer;
|
103 |
+
font-size: 11px;
|
104 |
+
font-weight: bold;
|
105 |
+
-webkit-touch-callout: none; /* iOS Safari */
|
106 |
+
-webkit-user-select: none; /* Safari */
|
107 |
+
-khtml-user-select: none; /* Konqueror HTML */
|
108 |
+
-moz-user-select: none; /* Firefox */
|
109 |
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
110 |
+
user-select: none; /* Non-prefixed version, currently */
|
111 |
+
background-color: rgba(75, 169, 61, 0.11);
|
112 |
+
}
|
113 |
+
|
114 |
+
#wpcf7cf-add-button {
|
115 |
+
margin-top: 10px;
|
116 |
+
text-align: center;
|
117 |
+
padding-left: 20px;
|
118 |
+
padding-right:20px;
|
119 |
+
}
|
120 |
+
|
121 |
+
overflow-x: auto;
|
122 |
+
|
123 |
+
.and-button:hover {
|
124 |
+
background-color: rgba(75, 169, 61, 0.2);
|
125 |
+
}
|
126 |
+
|
127 |
+
.delete-button {
|
128 |
+
border: 1px solid #bababa;
|
129 |
+
color: #858585;
|
130 |
+
background-color: transparent;
|
131 |
+
margin-left: 42px;
|
132 |
+
}
|
133 |
+
|
134 |
+
.delete-button:hover {
|
135 |
+
background-color: rgba(133, 133, 133, 0.11);
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
.and-button {
|
140 |
+
display:none;
|
141 |
+
width: 30px;
|
142 |
+
text-align: center;
|
143 |
+
}
|
144 |
+
.wpcf7cf-and-rule:first-child .and-button {
|
145 |
+
display: inline-block;
|
146 |
+
vertical-align: top;
|
147 |
+
height: 22px;
|
148 |
+
position: absolute;
|
149 |
+
line-height: 22px;
|
150 |
+
right: 50px;
|
151 |
+
top: 0;
|
152 |
+
}
|
153 |
+
|
154 |
+
.wpcf7cf-and-rule {
|
155 |
+
margin-bottom: 4px;
|
156 |
+
height: 30px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.wpcf7cf-and-rule .if-txt, .wpcf7cf-if > .label {
|
160 |
+
cursor: n-resize;
|
161 |
+
}
|
162 |
+
|
163 |
+
|
164 |
+
|
165 |
+
.wpcf7cf-and-rule .if-txt:before {
|
166 |
+
content: 'and';
|
167 |
+
position: absolute;
|
168 |
+
width: 30px;
|
169 |
+
text-align: right;
|
170 |
+
left: -34px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.wpcf7cf-and-rule:first-child .if-txt:before {
|
174 |
+
display:none;
|
175 |
+
}
|
176 |
+
|
177 |
+
.wpcf7cf-inner-container {
|
178 |
+
min-width: 800px;
|
179 |
+
}
|
180 |
+
|
181 |
+
.entry {
|
182 |
+
box-sizing: border-box;
|
183 |
+
display:flex;
|
184 |
+
}
|
185 |
+
|
186 |
+
.entry .wpcf7cf-if {
|
187 |
+
width: 188px;
|
188 |
+
}
|
189 |
+
|
190 |
+
.then-field-select {
|
191 |
+
width: 130px;
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
.entry .wpcf7cf-and-rules {
|
196 |
+
flex:1;
|
197 |
+
position:relative;
|
198 |
+
|
199 |
+
}
|
200 |
+
.wpcf7cf-and-rule {
|
201 |
+
display:flex;
|
202 |
+
}
|
203 |
+
.if-txt {
|
204 |
+
width: 14px;
|
205 |
+
text-align: center;
|
206 |
+
}
|
207 |
+
|
208 |
+
.operator {
|
209 |
+
/*width:140px;*/
|
210 |
+
}
|
211 |
+
|
212 |
+
.if-value {
|
213 |
+
flex:1;
|
214 |
+
margin-right:3px !important;
|
215 |
+
}
|
216 |
+
}
|
admin.php
CHANGED
@@ -15,7 +15,7 @@ function wpcf7cf_admin_enqueue_scripts( $hook_suffix ) {
|
|
15 |
add_filter('wpcf7_editor_panels', 'add_conditional_panel');
|
16 |
|
17 |
function add_conditional_panel($panels) {
|
18 |
-
$panels['
|
19 |
'title' => __( 'Conditional fields', 'wpcf7cf' ),
|
20 |
'callback' => 'wpcf7cf_editor_panel_conditional'
|
21 |
);
|
15 |
add_filter('wpcf7_editor_panels', 'add_conditional_panel');
|
16 |
|
17 |
function add_conditional_panel($panels) {
|
18 |
+
$panels['wpcf7cf-conditional-panel'] = array(
|
19 |
'title' => __( 'Conditional fields', 'wpcf7cf' ),
|
20 |
'callback' => 'wpcf7cf_editor_panel_conditional'
|
21 |
);
|
cf7cf.php
CHANGED
@@ -205,30 +205,17 @@ class ContactForm7ConditionalFields {
|
|
205 |
}
|
206 |
|
207 |
function hide_hidden_mail_fields( $components ) {
|
208 |
-
$regex = '@\[[\t ]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\t ]*\](.*?)\[[\t ]*/[\t ]*\1[\t ]*\]@s';
|
209 |
-
// [1] = name [2] = contents
|
210 |
|
211 |
-
$components
|
212 |
-
|
213 |
-
|
214 |
-
$components['recipient'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $components['recipient'] );
|
215 |
-
$components['additional_headers'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $components['additional_headers'] );
|
216 |
|
217 |
return $components;
|
218 |
}
|
219 |
|
220 |
function hide_hidden_mail_fields_additional_mail($additional_mail, $contact_form) {
|
221 |
-
|
222 |
if (!is_array($additional_mail) || !array_key_exists('mail_2', $additional_mail)) return $additional_mail;
|
223 |
-
|
224 |
-
$regex = '@\[[\t ]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\t ]*\](.*?)\[[\t ]*/[\t ]*\1[\t ]*\]@s';
|
225 |
-
|
226 |
-
$additional_mail['mail_2']['body'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $additional_mail['mail_2']['body'] );
|
227 |
-
$additional_mail['mail_2']['subject'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $additional_mail['mail_2']['subject'] );
|
228 |
-
$additional_mail['mail_2']['sender'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $additional_mail['mail_2']['sender'] );
|
229 |
-
$additional_mail['mail_2']['recipient'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $additional_mail['mail_2']['recipient'] );
|
230 |
-
$additional_mail['mail_2']['additional_headers'] = preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $additional_mail['mail_2']['additional_headers'] );
|
231 |
-
|
232 |
return $additional_mail;
|
233 |
}
|
234 |
|
@@ -240,11 +227,8 @@ class ContactForm7ConditionalFields {
|
|
240 |
return '';
|
241 |
} elseif ( in_array( $name, $this->visible_groups ) ) {
|
242 |
// The tag name represents a visible group, so remove the tags themselves, but return everything else
|
243 |
-
//return $content;
|
244 |
-
$regex = '@\[[\t ]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\t ]*\](.*?)\[[\t ]*/[\t ]*\1[\t ]*\]@s';
|
245 |
-
|
246 |
// instead of just returning the $content, return the preg_replaced content :)
|
247 |
-
return preg_replace_callback(
|
248 |
} else {
|
249 |
// The tag name doesn't represent a group that was used in the form. Leave it alone (return the entire match).
|
250 |
return $matches[0];
|
@@ -257,7 +241,9 @@ new ContactForm7ConditionalFields;
|
|
257 |
add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
|
258 |
|
259 |
function wpcf7cf_properties($properties, $wpcf7form) {
|
260 |
-
|
|
|
|
|
261 |
$form = $properties['form'];
|
262 |
|
263 |
$form_parts = preg_split('/(\[\/?group(?:\]|\s.*?\]))/',$form, -1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
205 |
}
|
206 |
|
207 |
function hide_hidden_mail_fields( $components ) {
|
|
|
|
|
208 |
|
209 |
+
foreach ($components as $key => $val) {
|
210 |
+
$components[$key] = preg_replace_callback(WPCF7CF_REGEX_MAIL_GROUP, array($this, 'hide_hidden_mail_fields_regex_callback'), $val );
|
211 |
+
}
|
|
|
|
|
212 |
|
213 |
return $components;
|
214 |
}
|
215 |
|
216 |
function hide_hidden_mail_fields_additional_mail($additional_mail, $contact_form) {
|
|
|
217 |
if (!is_array($additional_mail) || !array_key_exists('mail_2', $additional_mail)) return $additional_mail;
|
218 |
+
$additional_mail['mail_2'] = $this->hide_hidden_mail_fields($additional_mail['mail_2']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
return $additional_mail;
|
220 |
}
|
221 |
|
227 |
return '';
|
228 |
} elseif ( in_array( $name, $this->visible_groups ) ) {
|
229 |
// The tag name represents a visible group, so remove the tags themselves, but return everything else
|
|
|
|
|
|
|
230 |
// instead of just returning the $content, return the preg_replaced content :)
|
231 |
+
return preg_replace_callback(WPCF7CF_REGEX_MAIL_GROUP, array($this, 'hide_hidden_mail_fields_regex_callback'), $content );
|
232 |
} else {
|
233 |
// The tag name doesn't represent a group that was used in the form. Leave it alone (return the entire match).
|
234 |
return $matches[0];
|
241 |
add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
|
242 |
|
243 |
function wpcf7cf_properties($properties, $wpcf7form) {
|
244 |
+
// TODO: This function is called serveral times. The problem is that the filter is called each time we call get_properties() on a contact form.
|
245 |
+
// TODO: I haven't found a better way to solve this problem yet, any suggestions or push requests are welcome. (same problem in PRO/repeater.php)
|
246 |
+
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.
|
247 |
$form = $properties['form'];
|
248 |
|
249 |
$form_parts = preg_split('/(\[\/?group(?:\]|\s.*?\]))/',$form, -1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
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.4
|
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.4.1
|
8 |
Author URI: http://bdwm.be/
|
9 |
*/
|
10 |
|
init.php
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.4' );
|
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(file_exists(WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php')) {
|
11 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', true );
|
12 |
} else {
|
1 |
<?php
|
2 |
|
3 |
+
if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '1.4.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 |
+
|
13 |
if(file_exists(WPCF7CF_PLUGIN_DIR.'/pro/pro-functions.php')) {
|
14 |
if (!defined('WPCF7CF_IS_PRO')) define( 'WPCF7CF_IS_PRO', true );
|
15 |
} else {
|
js/scripts.js
CHANGED
@@ -257,6 +257,7 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
257 |
$hidden_group_fields = $form.find('[name="_wpcf7cf_hidden_group_fields"]');
|
258 |
$hidden_groups = $form.find('[name="_wpcf7cf_hidden_groups"]');
|
259 |
$visible_groups = $form.find('[name="_wpcf7cf_visible_groups"]');
|
|
|
260 |
|
261 |
var hidden_fields = [];
|
262 |
var hidden_groups = [];
|
@@ -301,15 +302,55 @@ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature
|
|
301 |
});
|
302 |
};
|
303 |
|
304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
|
307 |
-
|
308 |
|
309 |
-
|
310 |
-
// jQuery('[data-class="wpcf7cf_group"]').on('wpcf7cf_hide_group', function(e) {
|
311 |
-
// $group = jQuery(e.target);
|
312 |
-
// $group.find('input').not(':checkbox, :button, :submit, :reset, :hidden').val('');
|
313 |
-
// $group.find('option').removeAttr('selected');
|
314 |
-
// $group.find(':checkbox').removeAttr('checked');
|
315 |
-
// });
|
257 |
$hidden_group_fields = $form.find('[name="_wpcf7cf_hidden_group_fields"]');
|
258 |
$hidden_groups = $form.find('[name="_wpcf7cf_hidden_groups"]');
|
259 |
$visible_groups = $form.find('[name="_wpcf7cf_visible_groups"]');
|
260 |
+
$repeaters = $form.find('[name="_wpcf7cf_repeaters"]');
|
261 |
|
262 |
var hidden_fields = [];
|
263 |
var hidden_groups = [];
|
302 |
});
|
303 |
};
|
304 |
|
305 |
+
// PRO ONLY
|
306 |
+
|
307 |
+
$('.wpcf7cf_repeater').each(init_repeater);
|
308 |
+
|
309 |
+
function init_repeater(i) {
|
310 |
+
var $repeater = $(this);
|
311 |
+
$repeater.$last_sub = undefined;
|
312 |
+
$repeater.num_subs = 0;
|
313 |
+
$repeater.id = $repeater.attr('id');
|
314 |
+
var $repeater_sub = $repeater.find('.wpcf7cf_repeater_sub').eq(0);
|
315 |
+
var $repeater_controls = $repeater.find('.wpcf7cf_repeater_controls').eq(0);
|
316 |
+
|
317 |
+
$('.wpcf7cf_add',$repeater).click({
|
318 |
+
$repeater:$repeater,
|
319 |
+
$repeater_sub:$repeater_sub,
|
320 |
+
repeater_sub_html:$repeater_sub[0].outerHTML,
|
321 |
+
$repeater_controls:$repeater_controls
|
322 |
+
}, repeater_add_sub);
|
323 |
+
|
324 |
+
$('.wpcf7cf_remove',$repeater).click({
|
325 |
+
$repeater:$repeater,
|
326 |
+
$repeater_sub:$repeater_sub,
|
327 |
+
$repeater_controls:$repeater_controls
|
328 |
+
},repeater_remove_sub);
|
329 |
+
}
|
330 |
+
|
331 |
+
function repeater_add_sub(e) {
|
332 |
+
var $repeater = e.data.$repeater;
|
333 |
+
var $repeater_sub = e.data.$repeater_sub;
|
334 |
+
var $repeater_controls = e.data.$repeater_controls;
|
335 |
+
|
336 |
+
$repeater_controls.before(e.data.repeater_sub_html.replace(/name="(.*?)"/g,'name="wpcf7cf_repeater['+$repeater.id+']['+$repeater.num_subs+'][$1]"'));
|
337 |
+
|
338 |
+
$repeater.num_subs++;
|
339 |
+
return false;
|
340 |
+
}
|
341 |
+
|
342 |
+
function repeater_remove_sub(e) {
|
343 |
+
var $repeater = e.data.$repeater;
|
344 |
+
var $repeater_sub = e.data.$repeater_sub;
|
345 |
+
var $repeater_controls = e.data.$repeater_controls;
|
346 |
|
347 |
+
if ($repeater.num_subs <= 0) return;
|
348 |
+
$('.wpcf7cf_repeater_sub',$repeater).last().remove();
|
349 |
+
|
350 |
+
$repeater.num_subs--;
|
351 |
+
return false;
|
352 |
+
}
|
353 |
|
354 |
+
// END PRO ONLY
|
355 |
|
356 |
+
})( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
js/scripts_admin.js
CHANGED
@@ -45,7 +45,7 @@ var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
|
45 |
_wpcf7.taggen.compose = function(tagType, $form)
|
46 |
{
|
47 |
|
48 |
-
|
49 |
|
50 |
// original behavior - use function.apply to preserve context
|
51 |
var ret = old_compose.apply(this, arguments);
|
@@ -54,6 +54,8 @@ var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
|
54 |
|
55 |
// START: code here will be executed after the _wpcf7.taggen.update function
|
56 |
if (tagType== 'group') ret += "[/group]";
|
|
|
|
|
57 |
// END
|
58 |
|
59 |
if (tagType== 'togglebutton') {
|
@@ -169,8 +171,8 @@ var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
|
169 |
|
170 |
}
|
171 |
line += ' if [' + $and_rule.find('.if-field-select').val() + ']'
|
172 |
-
|
173 |
-
|
174 |
});
|
175 |
$('#wpcf7cf-settings-text').val($('#wpcf7cf-settings-text').val() + line + "\n" ).select();
|
176 |
});
|
@@ -249,8 +251,8 @@ var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
|
249 |
}).each(function() {
|
250 |
$(this).autocomplete( "instance" )._renderItem = function( ul, item ) {
|
251 |
return $("<li>")
|
252 |
-
|
253 |
-
|
254 |
}
|
255 |
});
|
256 |
$if_values.on('focus', function() {
|
@@ -298,10 +300,10 @@ var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
|
|
298 |
|
299 |
function scale_and_button() {
|
300 |
$('.wpcf7cf-and-rule:first-child .and-button').each(function(){
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
});
|
306 |
}
|
307 |
|
45 |
_wpcf7.taggen.compose = function(tagType, $form)
|
46 |
{
|
47 |
|
48 |
+
$('#tag-generator-panel-group-style-hidden').val($('#tag-generator-panel-group-style').val());
|
49 |
|
50 |
// original behavior - use function.apply to preserve context
|
51 |
var ret = old_compose.apply(this, arguments);
|
54 |
|
55 |
// START: code here will be executed after the _wpcf7.taggen.update function
|
56 |
if (tagType== 'group') ret += "[/group]";
|
57 |
+
if (tagType== 'repeater') ret += "[/repeater]";
|
58 |
+
|
59 |
// END
|
60 |
|
61 |
if (tagType== 'togglebutton') {
|
171 |
|
172 |
}
|
173 |
line += ' if [' + $and_rule.find('.if-field-select').val() + ']'
|
174 |
+
+ ' ' + $and_rule.find('.operator').val()
|
175 |
+
+ ' "' + $and_rule.find('.if-value').val() + '"';
|
176 |
});
|
177 |
$('#wpcf7cf-settings-text').val($('#wpcf7cf-settings-text').val() + line + "\n" ).select();
|
178 |
});
|
251 |
}).each(function() {
|
252 |
$(this).autocomplete( "instance" )._renderItem = function( ul, item ) {
|
253 |
return $("<li>")
|
254 |
+
.append("<div><em>" + item.label + "</em><br><em>" + item.desc + "</em></div>")
|
255 |
+
.appendTo(ul);
|
256 |
}
|
257 |
});
|
258 |
$if_values.on('focus', function() {
|
300 |
|
301 |
function scale_and_button() {
|
302 |
$('.wpcf7cf-and-rule:first-child .and-button').each(function(){
|
303 |
+
$and_button = $(this);
|
304 |
+
num_and_rules = $and_button.closest('.wpcf7cf-and-rule').siblings().length+1;
|
305 |
+
var height = (34*num_and_rules-12)+'px';
|
306 |
+
$and_button.css({'height':height,'line-height':height});
|
307 |
});
|
308 |
}
|
309 |
|
readme.txt
CHANGED
@@ -6,7 +6,8 @@ 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.8
|
9 |
-
Stable tag: 1.4
|
|
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -101,13 +102,19 @@ The conditional fields javascript code is loaded during wp_footer, so a call to
|
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
-
= 1.4 =
|
105 |
-
*
|
106 |
-
*
|
107 |
-
*
|
108 |
-
*
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
= 1.3.4 =
|
113 |
* small fix (https://wordpress.org/support/topic/wpcf7_contactform-object-is-no-longer-accessible/)
|
6 |
Tags: wordpress, contact form 7, forms, conditional fields
|
7 |
Requires at least: 4.1
|
8 |
Tested up to: 4.9.8
|
9 |
+
Stable tag: 1.4.1
|
10 |
+
Requires PHP: 5.3
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
102 |
|
103 |
== Changelog ==
|
104 |
|
105 |
+
= 1.4.1 (08-21-18) =
|
106 |
+
* Fixed some CSS issues (https://wordpress.org/support/topic/crash-view-admin-the-list-of-posts-entry/)
|
107 |
+
* Dropped support for PHP version 5.2, now PHP 5.3+ is required to run the plugin. Let's push things forward!
|
108 |
+
* Added conditional group support to mail attachments field (https://github.com/pwkip/contact-form-7-conditional-fields/issues/22)
|
109 |
+
* Added repeater field to PRO version.
|
110 |
+
|
111 |
+
= 1.4 (08-15-18) =
|
112 |
+
* Added basic drag and drop functionality to the back-end so conditional rules can be rearranged.
|
113 |
+
* Added possibility to create inline groups by adding the option inline. Example: `[group my-group inline] ... [/group]`
|
114 |
+
* Added property clear_on_hide to clear all fields within a group the moment the group gets hidden. Example: `[group my-group clear_on_hide] ... [/group]`
|
115 |
+
* Added AND conditions and added a bunch of other options in the PRO version (should be released very soon now)
|
116 |
+
* Bug fix thanks to Aurovrata Venet (@aurovrata) https://wordpress.org/support/topic/bug-plugin-overwrite-cf7-hidden-fields/
|
117 |
+
* Bug fix thanks to 972 creative (@toddedelman) https://wordpress.org/support/topic/conditional-fields-not-opening-using-radio-buttons/#post-10442923
|
118 |
|
119 |
= 1.3.4 =
|
120 |
* small fix (https://wordpress.org/support/topic/wpcf7_contactform-object-is-no-longer-accessible/)
|
wpcf7cf-options.php
CHANGED
@@ -76,7 +76,7 @@ function wpcf7cf_options_page() {
|
|
76 |
<li>Save the Contact Form</li>
|
77 |
<li>go to the <strong><em>Conditional Fields</em></strong> Tab</li>
|
78 |
</ol>
|
79 |
-
<a href="
|
80 |
</div></div>
|
81 |
<?php } ?>
|
82 |
<form action="options.php" method="post">
|
76 |
<li>Save the Contact Form</li>
|
77 |
<li>go to the <strong><em>Conditional Fields</em></strong> Tab</li>
|
78 |
</ol>
|
79 |
+
<a href="https://conditional-fields-cf7.bdwm.be/conditional-fields-for-contact-form-7-tutorial/" target="_blank">Show me an example</a> | <a class="notice-dismiss-2" href="#">Dismiss notice</a>
|
80 |
</div></div>
|
81 |
<?php } ?>
|
82 |
<form action="options.php" method="post">
|