Advanced Custom Fields: Extended - Version 0.7

Version Description

  • Field: Flexible Content - Added 'Stylised Button' setting which automatically hide native ACF 'empty' message and add style to 'Add row' button
  • Field: Flexible Content - Added 'Hide Empty Message' setting to hide native ACF 'empty' message
  • Field: Flexible Content - Added 'Empty Message' text setting to change the native ACF 'click the Add Row button below...' message
  • Field: Flexible Content - Added 'Layouts Thumbnails' setting to add image thumbnails for each layout in the admin layout selection
  • Field: Flexible Content - Added 'Layouts Render' setting to add template, style & script file for each layout. Those settings can be then accessed on the front-end
  • Field: Flexible Content - Added get_flexible($selector, $post_id) and the_flexible($selector, $post_id) functions to automatically use the 'Layouts Render' settings in front-end
  • Field: Flexible Content - Added 'Modal' setting to change the layout selection into a proper modal in the administration
  • Field: Flexible Content - Added 'Modal: Title' setting to change the layout modal title
  • Field: Flexible Content - Added 'Modal: Columns' setting to change the layout modal columns grid. 1, 2, 3, 4, 5 or 6 columns available
  • Field: Flexible Content - Added 'Modal: Categories' setting to add a category for each layout in the layout modal
  • Field: Flexible Content - Added 'Layouts State' setting to force layouts to be collapsed or opened by default
  • Field: Flexible Content - Added 'Button Label' native compatibility fix to make it work with Dashicons (CSS to fix vertical alignment)
  • Field: Flexible Content - Added 'One click' hidden function. In the post administration, the 'Add row' button will add a layout without the selection modal if there is only one layout available in the flexible content
  • Field: Flexible Content - Note - The following settings: Layouts Thumbnails, Layouts Render & Modal Categories will be visible after saving field group
  • Module: Ajax Author - Fixed a bug where field groups 'Hide on screen' setting wasn't applied on post administration
  • Module: Json AutoSync - Added "'/acf-json' folder not found" warning message if Json Sync is set in a field group and the '/acf-json' folder doesn't exists
  • Module: Taxonomy - Forced Tabs to be 'Aligned Top' in taxonomies fields (JS Only - ACF Bug) & added better CSS style (thanks to @Val_Pellegrin)
  • Module: Dynamic Post Type/Taxonomy/Option Page/Block Type - Hidden 'Minor publishing' panel (Save as draft, visibility...) to avoid confusion (thanks to @Val_Pellegrin)
  • Field: Bidirectional - Removed the 'bail early if old values =
Download this release

Release Info

Developer hwk-fr
Plugin Icon 128x128 Advanced Custom Fields: Extended
Version 0.7
Comparing to
See all releases

Code changes from version 0.6.7.2 to 0.7

acf-extended.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Advanced Custom Fields: Extended
4
  * Description: Enhancement Suite which improves Advanced Custom Fields administration
5
- * Version: 0.6.7.2
6
  * Author: ACF Extended
7
  * Author URI: https://www.acf-extended.com
8
  * Text Domain: acfe
@@ -63,6 +63,7 @@ function acfe_load(){
63
  */
64
  require_once(ACFE_PATH . 'includes/fields-settings/bidirectional.php');
65
  require_once(ACFE_PATH . 'includes/fields-settings/data.php');
 
66
  require_once(ACFE_PATH . 'includes/fields-settings/permissions.php');
67
  require_once(ACFE_PATH . 'includes/fields-settings/thumbnail.php');
68
  require_once(ACFE_PATH . 'includes/fields-settings/update.php');
2
  /**
3
  * Plugin Name: Advanced Custom Fields: Extended
4
  * Description: Enhancement Suite which improves Advanced Custom Fields administration
5
+ * Version: 0.7
6
  * Author: ACF Extended
7
  * Author URI: https://www.acf-extended.com
8
  * Text Domain: acfe
63
  */
64
  require_once(ACFE_PATH . 'includes/fields-settings/bidirectional.php');
65
  require_once(ACFE_PATH . 'includes/fields-settings/data.php');
66
+ require_once(ACFE_PATH . 'includes/fields-settings/flexible-content.php');
67
  require_once(ACFE_PATH . 'includes/fields-settings/permissions.php');
68
  require_once(ACFE_PATH . 'includes/fields-settings/thumbnail.php');
69
  require_once(ACFE_PATH . 'includes/fields-settings/update.php');
assets/acf-extended-fix.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- * ACFE: Dynamic Post Type Admin
3
  */
4
  .wrap .acfe-dpt-admin-config,
5
  .wrap .acfe-dpt-admin-config:active,
@@ -21,6 +21,34 @@
21
  color:#fff;
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /*
25
  * ACFE: Better Taxonomy - Archive
26
  */
@@ -46,6 +74,10 @@
46
  min-width:100%;
47
  }
48
 
 
 
 
 
49
  /*
50
  * ACFE: Better Taxonomy - Edit
51
  */
@@ -58,18 +90,19 @@
58
  .term-php #edittag .form-table{
59
  background:#fff;
60
  width:100%;
61
- border: 1px solid #e5e5e5;
62
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
63
  }
64
 
65
  .term-php #edittag .form-table td{
66
  background: #fff;
67
- border-top: 1px solid #eee;
 
68
  }
69
 
70
  .term-php #edittag .form-table tr:first-of-type td,
71
  .term-php #edittag .form-table tr:first-of-type th{
72
- border-top: 1px solid #e5e5e5;
73
  }
74
 
75
  .term-php #edittag .form-table td p{
@@ -78,8 +111,8 @@
78
 
79
  .term-php #edittag .form-table th,
80
  .term-php #edittag .form-table td.acf-label{
81
- border-top: 1px solid #eee;
82
- border-right: 1px solid #eee;
83
  background: #F9F9F9;
84
  padding:15px 12px;
85
  width:20%;
@@ -91,6 +124,20 @@
91
  position: initial;
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  .term-php #poststuff.acfe-acfe-bt-admin-column{
95
  min-width:auto;
96
  padding:0;
@@ -109,7 +156,7 @@
109
  }
110
 
111
  /*
112
- * ACFE: post Type Archive Box
113
  */
114
  #poststuff.acfe-post-type-archive-box{
115
  min-width:auto;
@@ -128,6 +175,35 @@
128
  font-weight:600 !important;
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  /*
132
  * ACF: Select2 Fix
133
  */
1
  /*
2
+ * ACFE: Dynamic Post Type 'Setting' Button
3
  */
4
  .wrap .acfe-dpt-admin-config,
5
  .wrap .acfe-dpt-admin-config:active,
21
  color:#fff;
22
  }
23
 
24
+ /*
25
+ * ACFE: Dynamic Post Type
26
+ */
27
+ body.post-type-acfe-dpt #minor-publishing{
28
+ display:none;
29
+ }
30
+
31
+ /*
32
+ * ACFE: Dynamic Taxonomy
33
+ */
34
+ body.post-type-acfe-dt #minor-publishing{
35
+ display:none;
36
+ }
37
+
38
+ /*
39
+ * ACFE: Dynamic Options Page
40
+ */
41
+ body.post-type-acfe-dop #minor-publishing{
42
+ display:none;
43
+ }
44
+
45
+ /*
46
+ * ACFE: Dynamic Block Type
47
+ */
48
+ body.post-type-acfe-dbt #minor-publishing{
49
+ display:none;
50
+ }
51
+
52
  /*
53
  * ACFE: Better Taxonomy - Archive
54
  */
74
  min-width:100%;
75
  }
76
 
77
+ .edit-tags-php #acfe-bt-form .submit.acf-field{
78
+ display:block !important;
79
+ }
80
+
81
  /*
82
  * ACFE: Better Taxonomy - Edit
83
  */
90
  .term-php #edittag .form-table{
91
  background:#fff;
92
  width:100%;
93
+ border: 1px solid #E1E1E1;
94
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
95
  }
96
 
97
  .term-php #edittag .form-table td{
98
  background: #fff;
99
+ border-top: 1px solid #E1E1E1;
100
+ position:initial;
101
  }
102
 
103
  .term-php #edittag .form-table tr:first-of-type td,
104
  .term-php #edittag .form-table tr:first-of-type th{
105
+ border-top: 1px solid #E1E1E1;
106
  }
107
 
108
  .term-php #edittag .form-table td p{
111
 
112
  .term-php #edittag .form-table th,
113
  .term-php #edittag .form-table td.acf-label{
114
+ border-top: 1px solid #E1E1E1;
115
+ border-right: 1px solid #E1E1E1;
116
  background: #F9F9F9;
117
  padding:15px 12px;
118
  width:20%;
124
  position: initial;
125
  }
126
 
127
+ .term-php #edittag .form-table tr.acf-tab-wrap > td{
128
+ background: #F9F9F9;
129
+ padding:15px 0 0 0;
130
+ }
131
+
132
+ .term-php #edittag .form-table tr.acf-tab-wrap > td ul.acf-tab-group{
133
+ border-bottom:0;
134
+ padding:0 0 0 20%;
135
+ }
136
+
137
+ .term-php #edittag .form-table tr.acf-tab-wrap > td ul.acf-tab-group > li.active a{
138
+ background: #fff;
139
+ }
140
+
141
  .term-php #poststuff.acfe-acfe-bt-admin-column{
142
  min-width:auto;
143
  padding:0;
156
  }
157
 
158
  /*
159
+ * ACFE: Post Type Archive Box
160
  */
161
  #poststuff.acfe-post-type-archive-box{
162
  min-width:auto;
175
  font-weight:600 !important;
176
  }
177
 
178
+ /*
179
+ * ACF: Repeater Block Fix (Add spacing)
180
+ */
181
+ .acf-repeater.-row > table,
182
+ .acf-repeater.-block > table{
183
+ border-collapse: separate;
184
+ border-spacing: 0 15px;
185
+ background: none;
186
+ border: 0;
187
+ margin-top: -15px;
188
+ margin-bottom: -7px;
189
+ }
190
+
191
+ .acf-repeater.-row > table > tbody > tr > td,
192
+ .acf-repeater.-block > table > tbody > tr > td{
193
+ border-top: 1px solid #E1E1E1;
194
+ border-bottom: 1px solid #E1E1E1;
195
+ }
196
+
197
+ .acf-repeater.-row > table > tbody > tr > td:first-of-type,
198
+ .acf-repeater.-block > table > tbody > tr > td:first-of-type{
199
+ border-left: 1px solid #E1E1E1;
200
+ }
201
+
202
+ .acf-repeater.-row > table > tbody > tr > td:last-of-type,
203
+ .acf-repeater.-block > table > tbody > tr > td:last-of-type{
204
+ border-right: 1px solid #E1E1E1;
205
+ }
206
+
207
  /*
208
  * ACF: Select2 Fix
209
  */
assets/acf-extended-flexible-content.css ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * ACFE: Modal
3
+ */
4
+ .ui-dialog{
5
+ z-index:100001 !important;
6
+ }
7
+
8
+ .ui-widget-overlay{
9
+ z-index:100000 !important;
10
+ }
11
+
12
+ /*
13
+ * ACFE: Flexible Modal
14
+ */
15
+ .acfe-fc-modal-wrap.ui-dialog{
16
+ position: fixed;
17
+ box-shadow:0 5px 15px rgba(0,0,0,0.7);
18
+ }
19
+
20
+ .acfe-fc-modal-wrap .ui-dialog-titlebar{
21
+ height: 50px;
22
+ line-height: 50px;
23
+ font-size: 22px;
24
+ color: #23282d;
25
+ border-bottom:1px solid #ddd;
26
+ }
27
+
28
+ .acfe-fc-modal-wrap .ui-button.ui-dialog-titlebar-close{
29
+ height: 50px;
30
+ width: 50px;
31
+ color:#72777c;
32
+ transition:color .1s ease-in-out, background .1s ease-in-out;
33
+ border-left:1px solid #ddd;
34
+ margin:0;
35
+ border-radius:0;
36
+ }
37
+
38
+ .acfe-fc-modal-wrap .ui-button.ui-dialog-titlebar-close:hover{
39
+ background: #ddd;
40
+ border-color: #ccc;
41
+ color: #000;
42
+ outline: none;
43
+ box-shadow: none;
44
+ }
45
+
46
+ .acfe-fc-modal-wrap .ui-button.ui-dialog-titlebar-close:before{
47
+ height: 50px;
48
+ width: 50px;
49
+ line-height:50px !important;
50
+ font: normal 22px/1 dashicons;
51
+ content: "\f335";
52
+ }
53
+
54
+ .acfe-fc-modal-wrap .ui-button:active {
55
+ transform:none;
56
+ }
57
+
58
+ .acfe-fc-modal-wrap .ui-dialog-content{
59
+ padding: 15px;
60
+ }
61
+
62
+ .acfe-fc-modal-content *{
63
+ -webkit-box-sizing:border-box;
64
+ box-sizing:border-box;
65
+ }
66
+
67
+ .acfe-fc-modal-content .nav-tab-wrapper{
68
+ padding:0;
69
+ margin:0;
70
+ margin-bottom:15px;
71
+ margin-top:-15px;
72
+ margin-left:-15px;
73
+ margin-right:-15px;
74
+ border-color:#ddd;
75
+ }
76
+
77
+ .acfe-fc-modal-content .nav-tab-wrapper a{
78
+ margin:0;
79
+ border-left:0;
80
+ border-top:0;
81
+ border-bottom:0;
82
+ background:#fff;
83
+ transition:color .1s ease-in-out, background .1s ease-in-out;
84
+ padding:7px 15px;
85
+ border-color:#ddd;
86
+ }
87
+
88
+ .acfe-fc-modal-content .nav-tab-wrapper a span.dashicons-menu{
89
+ line-height:27px;
90
+ }
91
+
92
+ .acfe-fc-modal-content .nav-tab-wrapper a:hover{
93
+ background:#f9f9f9;
94
+ color:#23282d;
95
+ }
96
+
97
+ .acfe-fc-modal-content .nav-tab-wrapper a.nav-tab-active,
98
+ .acfe-fc-modal-content .nav-tab-wrapper a.nav-tab-active:hover{
99
+ background:#fcfcfc;
100
+ color:#23282d;
101
+ }
102
+
103
+ .acfe-fc-modal-content .nav-tab:focus,
104
+ .acfe-fc-modal-content .nav-tab:focus:active {
105
+ border-bottom: 0;
106
+ box-shadow: none;
107
+ outline:0;
108
+ }
109
+
110
+ .acfe-fc-modal .acfe-flex-container{
111
+ width: 100%;
112
+ padding-right: 0;
113
+ padding-left: 0;
114
+ margin-right: auto;
115
+ margin-left: auto;
116
+ }
117
+
118
+ .acfe-fc-modal ul{
119
+ display: -ms-flexbox;
120
+ display: flex;
121
+ -ms-flex-wrap: wrap;
122
+ flex-wrap: wrap;
123
+ margin: 0;
124
+ margin-right: -7px;
125
+ margin-left: -7px;
126
+ }
127
+
128
+ .acfe-fc-modal ul:after{
129
+ content:"";
130
+ clear:both;
131
+ display:block;
132
+ }
133
+
134
+ .acfe-fc-modal ul li{
135
+ position: relative;
136
+ width: 100%;
137
+ padding-right: 7px;
138
+ padding-left: 7px;
139
+ padding-bottom: 14px;
140
+ margin:0;
141
+
142
+ -ms-flex: 0 0 25%;
143
+ flex: 0 0 25%;
144
+ max-width: 25%;
145
+ }
146
+
147
+ .acfe-fc-modal ul li a{
148
+ border:1px solid #ddd;
149
+ background:#F9F9F9;
150
+ padding:15px;
151
+ color:#333;
152
+ display:block;
153
+ text-decoration:none;
154
+ }
155
+
156
+ .acfe-fc-modal ul li a:hover{
157
+ background:#0073aa;
158
+ color:#fff;
159
+ }
160
+
161
+ .acfe-fc-modal ul li a span{
162
+ display:block;
163
+ font-size:13px;
164
+ text-align:center;
165
+ font-weight:600;
166
+ }
167
+
168
+ .acfe-fc-modal.acfe-fc-modal-col-1 ul li{
169
+ -ms-flex: 0 0 100%;
170
+ flex: 0 0 100%;
171
+ max-width: 100%;
172
+ }
173
+
174
+ .acfe-fc-modal.acfe-fc-modal-col-2 ul li{
175
+ -ms-flex: 0 0 50%;
176
+ flex: 0 0 50%;
177
+ max-width: 50%;
178
+ }
179
+
180
+ .acfe-fc-modal.acfe-fc-modal-col-3 ul li{
181
+ -ms-flex: 0 0 33.333333%;
182
+ flex: 0 0 33.333333%;
183
+ max-width: 33.333333%;
184
+ }
185
+
186
+ .acfe-fc-modal.acfe-fc-modal-col-4 ul li{
187
+ -ms-flex: 0 0 25%;
188
+ flex: 0 0 25%;
189
+ max-width: 25%;
190
+ }
191
+
192
+ .acfe-fc-modal.acfe-fc-modal-col-5 ul li{
193
+ -ms-flex: 0 0 20%;
194
+ flex: 0 0 20%;
195
+ max-width: 20%;
196
+ }
197
+
198
+ .acfe-fc-modal.acfe-fc-modal-col-6 ul li{
199
+ -ms-flex: 0 0 16.66%;
200
+ flex: 0 0 16.66%;
201
+ max-width: 16.66%;
202
+ }
203
+
204
+ @media only screen and (max-width:960px){
205
+ .acfe-fc-modal ul li{
206
+ -ms-flex: 0 0 50% !important;
207
+ flex: 0 0 50% !important;
208
+ max-width: 50% !important;
209
+ }
210
+ .acfe-fc-modal.acfe-fc-modal-col-1 ul li{
211
+ -ms-flex: 0 0 100% !important;
212
+ flex: 0 0 100% !important;
213
+ max-width: 100% !important;
214
+ }
215
+
216
+ .acfe-fc-modal ul li a{
217
+ padding:7px;
218
+ }
219
+ }
220
+
221
+ @media only screen and (max-width:720px){
222
+ .acfe-fc-modal ul li{
223
+ -ms-flex: 0 0 100% !important;
224
+ flex: 0 0 100% !important;
225
+ max-width: 100% !important;
226
+ }
227
+ .acfe-fc-modal.acfe-fc-modal-col-1 ul li{
228
+ -ms-flex: 0 0 100% !important;
229
+ flex: 0 0 100% !important;
230
+ max-width: 100% !important;
231
+ }
232
+ }
233
+
234
+ /*
235
+ * Admin: Thumbnails
236
+ *
237
+ */
238
+ .acfe-flexible-layout-thumbnail{
239
+ display:block;
240
+ width:100%;
241
+ height:200px;
242
+ background-color:#eee;
243
+ background-size:cover;
244
+ background-repeat:no-repeat;
245
+ background-position:center;
246
+ position:relative;
247
+ margin-bottom:10px;
248
+ }
249
+
250
+ .acfe-flexible-layout-thumbnail.acfe-flexible-layout-thumbnail-not-found:after{
251
+ content: "\f180";
252
+ font-family: dashicons;
253
+ display: inline-block;
254
+ line-height: 1;
255
+ font-weight: 400;
256
+ font-style: normal;
257
+ speak: none;
258
+ text-decoration: inherit;
259
+ text-transform: none;
260
+ text-rendering: auto;
261
+ -webkit-font-smoothing: antialiased;
262
+ -moz-osx-font-smoothing: grayscale;
263
+ vertical-align: top;
264
+ text-align: center;
265
+ position:absolute;
266
+ top:50%;
267
+ left:50%;
268
+ transform: translate(-50%, -50%);
269
+ color:#ccc;
270
+ font-size: 110px;
271
+ }
272
+
273
+ /*
274
+ * Admin: Thumbnails (no modal)
275
+ *
276
+ */
277
+ .acfe-flexible-layout-thumbnail.acfe-flexible-layout-thumbnail-no-modal{
278
+ display:block;
279
+ width: 230px;
280
+ height: 150px;
281
+ background-color:#1f2329;
282
+ }
283
+
284
+ .acfe-flexible-layout-thumbnail.acfe-flexible-layout-thumbnail-no-modal.acfe-flexible-layout-thumbnail-not-found:after{
285
+ color:#2F353E;
286
+ }
287
+
288
+ /*
289
+ * Admin: Stylised Button
290
+ *
291
+ */
292
+ .acf-field.acf-field-flexible-content[data-acfe-flexible-stylised-button="1"] > .acf-input > .acf-flexible-content:not(.empty) > .values{
293
+ margin-bottom:15px;
294
+ }
295
+
296
+ .acf-field.acf-field-flexible-content > .acf-input > .acf-flexible-content > .acfe-flexible-stylised-button{
297
+ padding: 40px 20px;
298
+ border: #ccc dashed 2px;
299
+ text-align: center;
300
+ }
301
+
302
+ .acf-field.acf-field-flexible-content > .acf-input > .acf-flexible-content > .acfe-flexible-stylised-button > .acf-actions{
303
+ text-align: center;
304
+ }
305
+
306
+ .acf-field.acf-field-flexible-content > .acf-input > .acf-flexible-content .acf-actions .acf-button .dashicons{
307
+ width: auto;
308
+ height: auto;
309
+ vertical-align: text-top;
310
+ }
311
+
312
+
313
+
314
+ /*
315
+ * Admin: Hide Empty Message
316
+ *
317
+ */
318
+ .acf-field.acf-field-flexible-content[data-acfe-flexible-hide-empty-message="1"] > .acf-input > .acf-flexible-content > .no-value-message{
319
+ display:none;
320
+ }
321
+
322
+ .acf-field.acf-field-flexible-content[data-acfe-flexible-hide-empty-message="1"] > .acf-input > .acf-flexible-content.-empty > .values{
323
+ margin-bottom:0;
324
+ }
325
+
326
+ /*
327
+ * Admin CSS
328
+ *
329
+ */
330
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields{
331
+ border:0;
332
+ }
333
+
334
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields .acf-field-acfe-flexible-modal-enabled{
335
+ padding:0;
336
+ }
337
+
338
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields .acf-field-acfe-flexible-modal-enabled .acf-label{
339
+ display:none;
340
+ }
341
+
342
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields .acf-field-acfe-flexible-modal-title,
343
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields .acf-field-acfe-flexible-modal-col,
344
+ .acf-field-acfe-flexible-modal > .acf-input > .acf-fields .acf-field-acfe-flexible-modal-categories{
345
+ padding-bottom:0;
346
+ padding-left:0;
347
+ border-top:0;
348
+ border-left:0 !important;
349
+ min-height:55px;
350
+ }
351
+
352
+ .acf-field-setting-fc_layout > .acf-input > .acf-fc-meta .acf-field[data-name=acfe_flexible_thumbnail],
353
+ .acf-field-setting-fc_layout > .acf-input > .acf-fc-meta .acf-field[data-name=acfe_flexible_category]{
354
+ margin:0;
355
+ }
assets/acf-extended-flexible-content.js ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ if(typeof acf === 'undefined')
4
+ return;
5
+
6
+ acf.addAction('new_field/type=flexible_content', function(flexible){
7
+
8
+ var $layouts = flexible.$clones();
9
+ var $layouts_added = flexible.$layouts();
10
+
11
+ // ACFE: Layout State - Collapse
12
+ if(flexible.$el.attr('data-acfe-flexible-collapse')){
13
+
14
+ if($layouts_added.length)
15
+ flexible.closeLayout($layouts_added);
16
+
17
+ }
18
+
19
+ // ACFE: Layout State - Open
20
+ if(flexible.$el.attr('data-acfe-flexible-open')){
21
+
22
+ if($layouts_added.length)
23
+ flexible.openLayout($layouts_added);
24
+
25
+ }
26
+
27
+ // ACFE: Stylised button
28
+ if(flexible.$el.attr('data-acfe-flexible-stylised-button')){
29
+
30
+ $(flexible.$el).find('> .acf-input > .acf-flexible-content > .acf-actions .button-primary').removeClass('button-primary');
31
+ $(flexible.$el).find('> .acf-input > .acf-flexible-content > .acf-actions').wrap('<div class="acfe-flexible-stylised-button" />');
32
+
33
+ }
34
+
35
+ // ACFE: Modal Prepare
36
+ if(flexible.$el.attr('data-acfe-flexible-modal')){
37
+
38
+ var flexible_layouts_html = flexible.getPopupHTML();
39
+
40
+ // Categories
41
+ var categories = [];
42
+ $(flexible_layouts_html).find('li a span').each(function(){
43
+
44
+ if(!$(this).data('acfe-flexible-category'))
45
+ return true;
46
+
47
+ var category = $(this).data('acfe-flexible-category');
48
+
49
+ if(categories.indexOf(category) != -1)
50
+ return true;
51
+
52
+ categories.push(category);
53
+
54
+ });
55
+
56
+ categories.sort();
57
+
58
+ var categories_html = '';
59
+
60
+ if(categories.length){
61
+
62
+ categories_html += '<h2 class="acfe-flexible-categories nav-tab-wrapper">';
63
+
64
+ categories_html += '<a href="#" data-acfe-flexible-category="acfe-all" class="nav-tab nav-tab-active"><span class="dashicons dashicons-menu"></span></a>';
65
+
66
+ $(categories).each(function(k, category){
67
+
68
+ categories_html += '<a href="#" data-acfe-flexible-category="' + category + '" class="nav-tab">' + category + '</a>';
69
+
70
+ });
71
+
72
+ categories_html += '</h2>';
73
+
74
+ }
75
+
76
+ $(flexible.$el).after(
77
+ '<div id="acfe-fc-modal-' + flexible.data.key + '" class="acfe-fc-modal acfe-fc-modal-content" style="display:none;">' +
78
+
79
+ categories_html +
80
+
81
+ '<div class="acfe-flex-container">' +
82
+
83
+ flexible.getPopupHTML() +
84
+
85
+ '</div>' +
86
+
87
+ '</div>'
88
+ );
89
+
90
+ flexible.acfe_flexible_modal = function(e, $el){
91
+
92
+ // validate
93
+ if(!this.validateAdd())
94
+ return false;
95
+
96
+ // within layout
97
+ var $layout = null;
98
+ if($el.hasClass('acf-icon')){
99
+ $layout = $el.closest('.layout');
100
+ $layout.addClass('-hover');
101
+ }
102
+
103
+ $('#acfe-fc-modal-' + flexible.data.key).dialog({
104
+ title: 'Add Row',
105
+ dialogClass: 'acfe-fc-modal-wrap',
106
+ autoOpen: false,
107
+ draggable: false,
108
+ width: $(window).width() - 60,
109
+ height: $(window).height() - 60,
110
+ modal: true,
111
+ resizable: false,
112
+ closeOnEscape: true,
113
+ position: {
114
+ my: "center",
115
+ at: "center",
116
+ of: window
117
+ },
118
+ open: function(){
119
+
120
+ $('.ui-widget-overlay, .acfe-fc-modal li a').bind('click', function(){
121
+ $('#acfe-fc-modal-' + flexible.data.key).dialog('close');
122
+ });
123
+
124
+ // Fix for ACF autofocus
125
+ $('.acfe-fc-modal li:first-of-type a').blur();
126
+
127
+ },
128
+ create: function(){
129
+
130
+ $('.ui-dialog-titlebar-close').addClass('ui-button');
131
+
132
+ $('.acfe-fc-modal li a').click(function(e){
133
+
134
+ e.preventDefault();
135
+
136
+ flexible.add({
137
+ layout: $(this).data('layout'),
138
+ before: $layout
139
+ });
140
+
141
+ });
142
+
143
+ $('.acfe-fc-modal .acfe-flexible-categories a').click(function(e){
144
+
145
+ e.preventDefault();
146
+
147
+ $('.acfe-fc-modal .acfe-flexible-categories a').removeClass('nav-tab-active');
148
+ $(this).addClass('nav-tab-active');
149
+
150
+ var selected_category = $(this).data('acfe-flexible-category');
151
+
152
+ $('.acfe-fc-modal li a span').each(function(){
153
+
154
+ var current_category = $(this).data('acfe-flexible-category');
155
+
156
+ $(this).closest('li').show();
157
+
158
+ if(selected_category != 'acfe-all' && current_category != selected_category){
159
+
160
+ $(this).closest('li').hide();
161
+
162
+ }
163
+
164
+ });
165
+
166
+ });
167
+
168
+ },
169
+ });
170
+
171
+ $('#acfe-fc-modal-' + flexible.data.key).dialog('open');
172
+
173
+ $(window).resize(function(){
174
+ $('#acfe-fc-modal-' + flexible.data.key).dialog("option", "position", {my: "center", at: "center", of: window});
175
+ $('#acfe-fc-modal-' + flexible.data.key).dialog("option", "width", $(window).width() - 60);
176
+ $('#acfe-fc-modal-' + flexible.data.key).dialog("option", "height", $(window).height() - 60);
177
+ });
178
+
179
+ // Modal Columns
180
+ if(flexible.$el.attr('data-acfe-flexible-modal-col')){
181
+
182
+ $('#acfe-fc-modal-' + flexible.data.key).addClass('acfe-fc-modal-col-' + flexible.$el.attr('data-acfe-flexible-modal-col'));
183
+
184
+ }
185
+
186
+ }
187
+
188
+ // Do not apply if OneClick
189
+ if($layouts.length > 1){
190
+
191
+ // Remove native ACF Tooltip action
192
+ flexible.removeEvents({'click [data-name="add-layout"]': 'onClickAdd'});
193
+
194
+ // Add ACF Extended Modal action
195
+ flexible.addEvents({'click [data-name="add-layout"]': 'acfe_flexible_modal'});
196
+
197
+ }
198
+
199
+ }
200
+
201
+ flexible.on('click', 'a[data-name="add-layout"]', function(e){
202
+
203
+ // ACFE: OneClick
204
+ if(!$layouts.length || $layouts.length > 1)
205
+ return;
206
+
207
+ var $layout_name = $($layouts[0]).attr('data-layout');
208
+
209
+ var $layout = null;
210
+ if($(this).hasClass('acf-icon')){
211
+ $layout = $(this).closest('.layout');
212
+ $layout.addClass('-hover');
213
+ }
214
+
215
+ flexible.add({
216
+ layout: $layout_name,
217
+ before: $layout
218
+ });
219
+
220
+ // Hide native ACF tooltip
221
+ if($('.acf-fc-popup').length)
222
+ $('.acf-fc-popup').hide();
223
+
224
+ });
225
+
226
+ });
227
+ })(jQuery);
includes/core/compatibility.php CHANGED
@@ -10,13 +10,14 @@ if(!defined('ABSPATH'))
10
  */
11
  add_filter('pto/posts_orderby/ignore', 'acfe_compatibility_pto_acf_field_group', 10, 3);
12
  function acfe_compatibility_pto_acf_field_group($ignore, $orderby, $query){
 
13
  if(is_admin() && $query->is_main_query() && $query->get('post_type') == 'acf-field-group')
14
  $ignore = true;
15
 
16
  return $ignore;
 
17
  }
18
 
19
-
20
  /**
21
  * Plugin: Category Order and Taxonomy Terms Order
22
  * https://wordpress.org/plugins/taxonomy-terms-order/
@@ -24,5 +25,31 @@ function acfe_compatibility_pto_acf_field_group($ignore, $orderby, $query){
24
  */
25
  add_action('admin_menu', 'acfe_compatibility_cotto_submenu', 999);
26
  function acfe_compatibility_cotto_submenu(){
 
27
  remove_submenu_page('edit.php?post_type=acf-field-group', 'to-interface-acf-field-group');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
10
  */
11
  add_filter('pto/posts_orderby/ignore', 'acfe_compatibility_pto_acf_field_group', 10, 3);
12
  function acfe_compatibility_pto_acf_field_group($ignore, $orderby, $query){
13
+
14
  if(is_admin() && $query->is_main_query() && $query->get('post_type') == 'acf-field-group')
15
  $ignore = true;
16
 
17
  return $ignore;
18
+
19
  }
20
 
 
21
  /**
22
  * Plugin: Category Order and Taxonomy Terms Order
23
  * https://wordpress.org/plugins/taxonomy-terms-order/
25
  */
26
  add_action('admin_menu', 'acfe_compatibility_cotto_submenu', 999);
27
  function acfe_compatibility_cotto_submenu(){
28
+
29
  remove_submenu_page('edit.php?post_type=acf-field-group', 'to-interface-acf-field-group');
30
+
31
+ }
32
+
33
+ /**
34
+ * Plugin: Rank Math SEO
35
+ * https://wordpress.org/plugins/seo-by-rank-math/
36
+ * Fix the plugin post metabox which is always above ACF metaboxes
37
+ */
38
+ add_filter('rank_math/metabox/priority', 'acfe_compatibility_rankmath_metaboxes_priority');
39
+ function acfe_compatibility_rankmath_metaboxes_priority(){
40
+
41
+ return 'default';
42
+
43
+ }
44
+
45
+ /**
46
+ * Plugin: YOAST SEO
47
+ * https://wordpress.org/plugins/wordpress-seo/
48
+ * Fix the plugin post metabox which is always above ACF metaboxes
49
+ */
50
+ add_filter('wpseo_metabox_prio', 'acfe_compatibility_yoast_metaboxes_priority');
51
+ function acfe_compatibility_yoast_metaboxes_priority(){
52
+
53
+ return 'default';
54
+
55
  }
includes/core/enqueue.php CHANGED
@@ -9,23 +9,27 @@ if(!defined('ABSPATH'))
9
  add_action('admin_enqueue_scripts', 'acfe_enqueue_admin');
10
  function acfe_enqueue_admin(){
11
 
12
- // ACF CSS Fix
13
  wp_enqueue_style('acf-extended-fix', plugins_url('assets/acf-extended-fix.css', ACFE_FILE), false, null);
14
 
 
15
  wp_enqueue_style('acf-input');
16
  wp_enqueue_script('acf-input');
17
 
18
- if(!acf_is_screen(array('edit-acf-field-group', 'acf-field-group')))
19
- return;
20
-
21
- // CSS
22
  wp_enqueue_style('wp-jquery-ui-dialog');
23
- wp_enqueue_style('acf-extended', plugins_url('assets/acf-extended.css', ACFE_FILE), false, null);
24
-
25
- // JS
26
  wp_enqueue_script('jquery-ui-core');
27
  wp_enqueue_script('jquery-ui-dialog');
28
- wp_enqueue_script('acf-extended', plugins_url('assets/acf-extended.js', ACFE_FILE), array('jquery'), null);
 
 
 
 
 
 
 
 
 
29
 
30
  }
31
 
@@ -34,4 +38,8 @@ function acfe_enqueue_fields(){
34
 
35
  wp_enqueue_script('acf-extended-fields', plugins_url('assets/acf-extended-fields.js', ACFE_FILE), array('jquery'), null);
36
 
 
 
 
 
37
  }
9
  add_action('admin_enqueue_scripts', 'acfe_enqueue_admin');
10
  function acfe_enqueue_admin(){
11
 
12
+ // ACF Extended: Fix
13
  wp_enqueue_style('acf-extended-fix', plugins_url('assets/acf-extended-fix.css', ACFE_FILE), false, null);
14
 
15
+ // ACF Extended: Enqueue ACF
16
  wp_enqueue_style('acf-input');
17
  wp_enqueue_script('acf-input');
18
 
19
+ // ACF Extended: WP jQuery UI Dialog
 
 
 
20
  wp_enqueue_style('wp-jquery-ui-dialog');
 
 
 
21
  wp_enqueue_script('jquery-ui-core');
22
  wp_enqueue_script('jquery-ui-dialog');
23
+
24
+ if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group'))){
25
+
26
+ // CSS
27
+ wp_enqueue_style('acf-extended', plugins_url('assets/acf-extended.css', ACFE_FILE), false, null);
28
+
29
+ // JS
30
+ wp_enqueue_script('acf-extended', plugins_url('assets/acf-extended.js', ACFE_FILE), array('jquery'), null);
31
+
32
+ }
33
 
34
  }
35
 
38
 
39
  wp_enqueue_script('acf-extended-fields', plugins_url('assets/acf-extended-fields.js', ACFE_FILE), array('jquery'), null);
40
 
41
+ // ACF Extended: Flexible Content
42
+ wp_enqueue_style('acf-extended-fc', plugins_url('assets/acf-extended-flexible-content.css', ACFE_FILE), false, null);
43
+ wp_enqueue_script('acf-extended-fc', plugins_url('assets/acf-extended-flexible-content.js', ACFE_FILE), array('jquery'), null);
44
+
45
  }
includes/core/helpers.php CHANGED
@@ -3,9 +3,72 @@
3
  if(!defined('ABSPATH'))
4
  exit;
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  /**
7
  * Get Field Group from Field
8
- *
9
  */
10
  function acfe_get_field_group_from_field($field){
11
 
@@ -27,7 +90,6 @@ function acfe_get_field_group_from_field($field){
27
  /**
28
  * Is Json
29
  * Source: https://stackoverflow.com/a/6041773
30
- *
31
  */
32
  function acfe_is_json($string){
33
 
@@ -40,6 +102,9 @@ function acfe_is_json($string){
40
 
41
  }
42
 
 
 
 
43
  function acfe_get_roles(){
44
 
45
  global $wp_roles;
@@ -56,6 +121,9 @@ function acfe_get_roles(){
56
 
57
  }
58
 
 
 
 
59
  function acfe_get_current_user_roles(){
60
 
61
  global $current_user;
@@ -69,4 +137,16 @@ function acfe_get_current_user_roles(){
69
 
70
  return $roles;
71
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
3
  if(!defined('ABSPATH'))
4
  exit;
5
 
6
+ /**
7
+ * Get Flexible
8
+ */
9
+ if(!function_exists('get_flexible')){
10
+
11
+ function get_flexible($selector, $post_id = false){
12
+
13
+ if(!have_rows($selector, $post_id))
14
+ return;
15
+
16
+ $field = acf_get_field($selector);
17
+ $acf_field_flexible_content = new acf_field_flexible_content();
18
+
19
+ ob_start();
20
+
21
+ while(have_rows($selector)): the_row();
22
+
23
+ $layout_title = get_row_layout();
24
+ $layout = $acf_field_flexible_content->get_layout($layout_title, $field);
25
+
26
+ // Render: Style
27
+ if(isset($layout['acfe_flexible_render_style']) && !empty($layout['acfe_flexible_render_style'])){
28
+
29
+ if(file_exists(ACFE_THEME_PATH . '/' . $layout['acfe_flexible_render_style']))
30
+ echo '<link rel="stylesheet" href="' . ACFE_THEME_URL . '/' . $layout['acfe_flexible_render_style'] . '" type="text/css">';
31
+
32
+ }
33
+
34
+ // Render: Script
35
+ if(isset($layout['acfe_flexible_render_script']) && !empty($layout['acfe_flexible_render_script'])){
36
+
37
+ if(file_exists(ACFE_THEME_PATH . '/' . $layout['acfe_flexible_render_script']))
38
+ echo '<script src="' . ACFE_THEME_URL . '/' . $layout['acfe_flexible_render_script'] . '"></script>';
39
+
40
+ }
41
+
42
+ // Render: Template
43
+ if(isset($layout['acfe_flexible_render_template']) && !empty($layout['acfe_flexible_render_template'])){
44
+
45
+ locate_template(array($layout['acfe_flexible_render_template']), true);
46
+
47
+ }
48
+
49
+ endwhile;
50
+
51
+ return ob_get_clean();
52
+
53
+ }
54
+
55
+ }
56
+
57
+ /**
58
+ * The Flexible
59
+ */
60
+ if(!function_exists('the_flexible')){
61
+
62
+ function the_flexible($selector, $post_id = false){
63
+
64
+ echo get_flexible($selector, $post_id);
65
+
66
+ }
67
+
68
+ }
69
+
70
  /**
71
  * Get Field Group from Field
 
72
  */
73
  function acfe_get_field_group_from_field($field){
74
 
90
  /**
91
  * Is Json
92
  * Source: https://stackoverflow.com/a/6041773
 
93
  */
94
  function acfe_is_json($string){
95
 
102
 
103
  }
104
 
105
+ /**
106
+ * Get Roles
107
+ */
108
  function acfe_get_roles(){
109
 
110
  global $wp_roles;
121
 
122
  }
123
 
124
+ /**
125
+ * Get Current Roles
126
+ */
127
  function acfe_get_current_user_roles(){
128
 
129
  global $current_user;
137
 
138
  return $roles;
139
 
140
+ }
141
+
142
+ /**
143
+ * Folder Exists
144
+ */
145
+ function acfe_folder_exists($folder){
146
+
147
+ if(!is_dir(ACFE_THEME_PATH . '/' . $folder))
148
+ return false;
149
+
150
+ return true;
151
+
152
  }
includes/field-groups/field-group.php CHANGED
@@ -346,7 +346,18 @@ function acfe_render_field_acfe_sync_warnings($field){
346
 
347
  // Json
348
  if(acfe_has_field_group_autosync($field_group, 'json') && !acfe_has_field_group_autosync_file($field_group, 'json')){
349
- echo '<p class="description"><span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="dashicons dashicons-warning"></span> <code style="font-size:11px;">' . $field_group['key'] . '.json</code> will be created upon update.</p>';
 
 
 
 
 
 
 
 
 
 
 
350
  }
351
 
352
  }
346
 
347
  // Json
348
  if(acfe_has_field_group_autosync($field_group, 'json') && !acfe_has_field_group_autosync_file($field_group, 'json')){
349
+
350
+ if(!acfe_folder_exists('acf-json')){
351
+
352
+ echo '<p class="description"><span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="dashicons dashicons-warning"></span> Folder <code style="font-size:11px;">/acf-json</code> was not found in your theme. You must create it to activate Json Sync.</p>';
353
+
354
+ }
355
+
356
+ else{
357
+
358
+ echo '<p class="description"><span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="dashicons dashicons-warning"></span> <code style="font-size:11px;">' . $field_group['key'] . '.json</code> will be created upon update.</p>';
359
+
360
+ }
361
  }
362
 
363
  }
includes/field-groups/field-groups.php CHANGED
@@ -61,7 +61,7 @@ function acfe_field_groups_column($columns){
61
 
62
  }
63
 
64
- // Fix 'Thirs party' screen columns
65
  elseif(acf_maybe_get_GET('post_status') === 'acfe-third-party'){
66
 
67
  unset($columns['cb']);
@@ -262,7 +262,7 @@ function acfe_field_groups_column_html($column, $post_id){
262
 
263
  elseif(!acfe_has_field_group_autosync_file($field_group, 'php')){
264
  echo '<span style="color:#ccc" class="dashicons dashicons-yes"></span>';
265
- echo '<span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="acf-js-tooltip dashicons dashicons-warning" title="Local file ' . $field_group['key'] . '.php will be created upon next update"></span>';
266
  }
267
 
268
  else{
@@ -282,7 +282,9 @@ function acfe_field_groups_column_html($column, $post_id){
282
  return;
283
 
284
  if(acfe_has_field_group_autosync_file($field_group, 'json')){
 
285
  echo '<span class="dashicons dashicons-yes"></span>';
 
286
  }
287
 
288
  else{
@@ -294,7 +296,20 @@ function acfe_field_groups_column_html($column, $post_id){
294
  }else{
295
 
296
  echo '<span style="color:#ccc" class="dashicons dashicons-yes"></span>';
297
- echo '<span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="acf-js-tooltip dashicons dashicons-warning" title="Local file ' . $field_group['key'] . '.json will be created upon next update."></span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
  }
300
 
61
 
62
  }
63
 
64
+ // Fix 'Third party' screen columns
65
  elseif(acf_maybe_get_GET('post_status') === 'acfe-third-party'){
66
 
67
  unset($columns['cb']);
262
 
263
  elseif(!acfe_has_field_group_autosync_file($field_group, 'php')){
264
  echo '<span style="color:#ccc" class="dashicons dashicons-yes"></span>';
265
+ echo '<span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="acf-js-tooltip dashicons dashicons-warning" title="Local file ' . $field_group['key'] . '.php will be created upon update"></span>';
266
  }
267
 
268
  else{
282
  return;
283
 
284
  if(acfe_has_field_group_autosync_file($field_group, 'json')){
285
+
286
  echo '<span class="dashicons dashicons-yes"></span>';
287
+
288
  }
289
 
290
  else{
296
  }else{
297
 
298
  echo '<span style="color:#ccc" class="dashicons dashicons-yes"></span>';
299
+
300
+ if(!acfe_folder_exists('acf-json')){
301
+
302
+ echo '<span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="acf-js-tooltip dashicons dashicons-warning" title="Folder \'/acf-json\' was not found in your theme.<br />You must create it to activate this setting"></span>';
303
+
304
+ }
305
+
306
+ else{
307
+
308
+ echo '<span style="color:#ccc;font-size:16px;vertical-align:text-top;" class="acf-js-tooltip dashicons dashicons-warning" title="Local file ' . $field_group['key'] . '.json will be created upon update."></span>';
309
+
310
+ }
311
+
312
+
313
 
314
  }
315
 
includes/fields-settings/bidirectional.php CHANGED
@@ -367,8 +367,8 @@ function acfe_bidirectional_update_value($value, $post_id, $field){
367
  $new_values = acf_get_array($value);
368
 
369
  // Bail early if no difference
370
- if($old_values == $new_values)
371
- return $value;
372
 
373
  // Values have been removed
374
  if(!empty($old_values)){
367
  $new_values = acf_get_array($value);
368
 
369
  // Bail early if no difference
370
+ //if($old_values == $new_values)
371
+ // return $value;
372
 
373
  // Values have been removed
374
  if(!empty($old_values)){
includes/fields-settings/flexible-content.php ADDED
@@ -0,0 +1,509 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!defined('ABSPATH'))
4
+ exit;
5
+
6
+ /**
7
+ * Add Settings
8
+ */
9
+ add_action('acf/render_field_settings/type=flexible_content', 'acfe_flexible_settings', 0);
10
+ function acfe_flexible_settings($field){
11
+
12
+ // Stylised button
13
+ acf_render_field_setting($field, array(
14
+ 'label' => __('Stylised button'),
15
+ 'name' => 'acfe_flexible_stylised_button',
16
+ 'key' => 'acfe_flexible_stylised_button',
17
+ 'instructions' => __('Better layouts button integration'),
18
+ 'type' => 'true_false',
19
+ 'message' => '',
20
+ 'default_value' => false,
21
+ 'ui' => true,
22
+ 'ui_on_text' => '',
23
+ 'ui_off_text' => '',
24
+ ), true);
25
+
26
+ // Hide Empty Message
27
+ acf_render_field_setting($field, array(
28
+ 'label' => __('Hide Empty Message'),
29
+ 'name' => 'acfe_flexible_hide_empty_message',
30
+ 'key' => 'acfe_flexible_hide_empty_message',
31
+ 'instructions' => __('Hide the empty message box'),
32
+ 'type' => 'true_false',
33
+ 'message' => '',
34
+ 'default_value' => false,
35
+ 'ui' => true,
36
+ 'ui_on_text' => '',
37
+ 'ui_off_text' => '',
38
+ 'conditional_logic' => array(
39
+ array(
40
+ array(
41
+ 'field' => 'acfe_flexible_stylised_button',
42
+ 'operator' => '!=',
43
+ 'value' => '1',
44
+ ),
45
+ )
46
+ )
47
+ ), true);
48
+
49
+ // Empty Message
50
+ acf_render_field_setting($field, array(
51
+ 'label' => __('Empty Message'),
52
+ 'name' => 'acfe_flexible_empty_message',
53
+ 'key' => 'acfe_flexible_empty_message',
54
+ 'instructions' => __('Text displayed when the flexible field is empty'),
55
+ 'type' => 'text',
56
+ 'placeholder' => _('Click the "Add Row" button below to start creating your layout'),
57
+ 'conditional_logic' => array(
58
+ array(
59
+ array(
60
+ 'field' => 'acfe_flexible_stylised_button',
61
+ 'operator' => '!=',
62
+ 'value' => '1',
63
+ ),
64
+ array(
65
+ 'field' => 'acfe_flexible_hide_empty_message',
66
+ 'operator' => '!=',
67
+ 'value' => '1',
68
+ )
69
+ )
70
+ )
71
+ ), true);
72
+
73
+ // Layouts thumbnails
74
+ acf_render_field_setting($field, array(
75
+ 'label' => __('Layouts Thumbnails'),
76
+ 'name' => 'acfe_flexible_layouts_thumbnails',
77
+ 'key' => 'acfe_flexible_layouts_thumbnails',
78
+ 'instructions' => __('Display thumbnails for each layout. You need to save the field group to take effect'),
79
+ 'type' => 'true_false',
80
+ 'message' => '',
81
+ 'default_value' => false,
82
+ 'ui' => true,
83
+ 'ui_on_text' => '',
84
+ 'ui_off_text' => '',
85
+ ), true);
86
+
87
+ // Layouts render
88
+ acf_render_field_setting($field, array(
89
+ 'label' => __('Layouts Render'),
90
+ 'name' => 'acfe_flexible_layouts_templates',
91
+ 'key' => 'acfe_flexible_layouts_templates',
92
+ 'instructions' => __('Display PHP template, style & javascript includes fields. You need to save the field group to take effect'),
93
+ 'type' => 'true_false',
94
+ 'message' => '',
95
+ 'default_value' => false,
96
+ 'ui' => true,
97
+ 'ui_on_text' => '',
98
+ 'ui_off_text' => '',
99
+ ), true);
100
+
101
+ // Modal
102
+ acf_render_field_setting($field, array(
103
+ 'label' => __('Modal'),
104
+ 'name' => 'acfe_flexible_modal',
105
+ 'key' => 'acfe_flexible_modal',
106
+ 'instructions' => __('Use modal for layout selection'),
107
+ 'type' => 'group',
108
+ 'layout' => 'block',
109
+ 'sub_fields' => array(
110
+ array(
111
+ 'label' => '',
112
+ 'name' => 'acfe_flexible_modal_enabled',
113
+ 'key' => 'acfe_flexible_modal_enabled',
114
+ 'type' => 'true_false',
115
+ 'instructions' => '',
116
+ 'required' => false,
117
+ 'wrapper' => array(
118
+ 'width' => '',
119
+ 'class' => '',
120
+ 'id' => '',
121
+ ),
122
+ 'message' => '',
123
+ 'default_value' => false,
124
+ 'ui' => true,
125
+ 'ui_on_text' => '',
126
+ 'ui_off_text' => '',
127
+ 'conditional_logic' => false,
128
+ ),
129
+ array(
130
+ 'label' => '',
131
+ 'name' => 'acfe_flexible_modal_title',
132
+ 'key' => 'acfe_flexible_modal_title',
133
+ 'type' => 'text',
134
+ 'prepend' => __('Title'),
135
+ 'placeholder' => 'Add Row',
136
+ 'instructions' => false,
137
+ 'required' => false,
138
+ 'wrapper' => array(
139
+ 'width' => '35',
140
+ 'class' => '',
141
+ 'id' => '',
142
+ ),
143
+ 'conditional_logic' => array(
144
+ array(
145
+ array(
146
+ 'field' => 'acfe_flexible_modal_enabled',
147
+ 'operator' => '==',
148
+ 'value' => '1',
149
+ )
150
+ )
151
+ )
152
+ ),
153
+ array(
154
+ 'label' => '',
155
+ 'name' => 'acfe_flexible_modal_col',
156
+ 'key' => 'acfe_flexible_modal_col',
157
+ 'type' => 'select',
158
+ 'prepend' => '',
159
+ 'instructions' => false,
160
+ 'required' => false,
161
+ 'choices' => array(
162
+ '1' => '1 column',
163
+ '2' => '2 columns',
164
+ '3' => '3 columns',
165
+ '4' => '4 columns',
166
+ '5' => '5 columns',
167
+ '6' => '6 columns',
168
+ ),
169
+ 'default_value' => '4',
170
+ 'wrapper' => array(
171
+ 'width' => '15',
172
+ 'class' => '',
173
+ 'id' => '',
174
+ ),
175
+ 'conditional_logic' => array(
176
+ array(
177
+ array(
178
+ 'field' => 'acfe_flexible_modal_enabled',
179
+ 'operator' => '==',
180
+ 'value' => '1',
181
+ )
182
+ )
183
+ )
184
+ ),
185
+ array(
186
+ 'label' => '',
187
+ 'name' => 'acfe_flexible_modal_categories',
188
+ 'key' => 'acfe_flexible_modal_categories',
189
+ 'type' => 'true_false',
190
+ 'message' => __('Categories'),
191
+ 'instructions' => false,
192
+ 'required' => false,
193
+ 'wrapper' => array(
194
+ 'width' => '15',
195
+ 'class' => '',
196
+ 'id' => '',
197
+ ),
198
+ 'conditional_logic' => array(
199
+ array(
200
+ array(
201
+ 'field' => 'acfe_flexible_modal_enabled',
202
+ 'operator' => '==',
203
+ 'value' => '1',
204
+ )
205
+ )
206
+ )
207
+ ),
208
+ )
209
+ ), true);
210
+
211
+ // Layouts State
212
+ acf_render_field_setting($field, array(
213
+ 'label' => __('Layouts State'),
214
+ 'name' => 'acfe_flexible_layouts_state',
215
+ 'key' => 'acfe_flexible_layouts_state',
216
+ 'instructions' => __('Force layouts to be collapsed or opened'),
217
+ 'type' => 'select',
218
+ 'allow_null' => true,
219
+ 'choices' => array(
220
+ 'collapse' => 'Collapsed',
221
+ 'open' => 'Opened',
222
+ )
223
+ ), true);
224
+
225
+ }
226
+
227
+ add_action('acf/render_field', 'acfe_flexible_layouts_settings', 0);
228
+ function acfe_flexible_layouts_settings($field){
229
+
230
+ if($field['_name'] != 'label' || stripos($field['name'], 'layout_') === false)
231
+ return;
232
+
233
+ $layout_prefix = $field['prefix'];
234
+
235
+ preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr){
236
+ $arr[] = explode(',',preg_replace('/([\w]+)/', "$1", $m[1]));
237
+ }, $layout_prefix);
238
+
239
+ $layout_key = $arr[2][0];
240
+ $field_flexible_id = $arr[0][0];
241
+
242
+ $field_flexible = acf_get_field($field_flexible_id);
243
+
244
+ $layout = $field_flexible['layouts'][$layout_key];
245
+
246
+ $echo = false;
247
+
248
+ $is_flexible_layouts_thumbnails = isset($field_flexible['acfe_flexible_layouts_thumbnails']) && !empty($field_flexible['acfe_flexible_layouts_thumbnails']);
249
+ $is_flexible_layouts_templates = isset($field_flexible['acfe_flexible_layouts_templates']) && !empty($field_flexible['acfe_flexible_layouts_templates']);
250
+ $is_flexible_modal_enabled = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']);
251
+ $is_flexible_modal_categories = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']);
252
+
253
+ if($is_flexible_layouts_thumbnails || $is_flexible_layouts_templates || ($is_flexible_modal_enabled && $is_flexible_modal_categories)){
254
+
255
+ $echo = true;
256
+
257
+ ?>
258
+ </li>
259
+ <?php
260
+
261
+ }
262
+
263
+ // Thumbnail
264
+ if($is_flexible_layouts_thumbnails){
265
+
266
+ $acfe_flexible_thumbnail = isset($layout['acfe_flexible_thumbnail']) ? $layout['acfe_flexible_thumbnail'] : '';
267
+
268
+ echo '<li>';
269
+
270
+ echo '<div class="acf-label"><label>' . __('Thumbnail') . '</label></div>';
271
+
272
+ acf_render_field_wrap(array(
273
+ 'label' => false,
274
+ 'name' => 'acfe_flexible_thumbnail',
275
+ 'type' => 'image',
276
+ 'class' => '',
277
+ 'prefix' => $layout_prefix,
278
+ 'value' => $acfe_flexible_thumbnail,
279
+ 'return_format' => 'array',
280
+ 'preview_size' => 'thumbnail',
281
+ 'library' => 'all',
282
+ ));
283
+
284
+ echo '</li>';
285
+
286
+ }
287
+
288
+ // Template
289
+ if($is_flexible_layouts_templates){
290
+
291
+ $acfe_flexible_render_template = isset($layout['acfe_flexible_render_template']) ? $layout['acfe_flexible_render_template'] : '';
292
+
293
+ echo '<li>';
294
+
295
+ echo '<div class="acf-label"><label>Render</label></div>';
296
+
297
+ acf_render_field(array(
298
+ 'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
299
+ 'name' => 'acfe_flexible_render_template',
300
+ 'type' => 'text',
301
+ 'class' => 'acf-fc-meta-name',
302
+ 'prefix' => $layout_prefix,
303
+ 'value' => $acfe_flexible_render_template,
304
+ 'placeholder' => 'template.php'
305
+ ));
306
+
307
+ echo '</li>';
308
+
309
+ $acfe_flexible_render_style = isset($layout['acfe_flexible_render_style']) ? $layout['acfe_flexible_render_style'] : '';
310
+
311
+ echo '<li>';
312
+
313
+ acf_render_field(array(
314
+ 'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
315
+ 'name' => 'acfe_flexible_render_style',
316
+ 'type' => 'text',
317
+ 'class' => 'acf-fc-meta-name',
318
+ 'prefix' => $layout_prefix,
319
+ 'value' => $acfe_flexible_render_style,
320
+ 'placeholder' => 'style.css'
321
+ ));
322
+
323
+ echo '</li>';
324
+
325
+ $acfe_flexible_render_script = isset($layout['acfe_flexible_render_script']) ? $layout['acfe_flexible_render_script'] : '';
326
+
327
+ echo '<li>';
328
+
329
+ acf_render_field(array(
330
+ 'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
331
+ 'name' => 'acfe_flexible_render_script',
332
+ 'type' => 'text',
333
+ 'class' => 'acf-fc-meta-name',
334
+ 'prefix' => $layout_prefix,
335
+ 'value' => $acfe_flexible_render_script,
336
+ 'placeholder' => 'script.js'
337
+ ));
338
+
339
+ echo '</li>';
340
+
341
+ }
342
+
343
+ // Category
344
+ if($is_flexible_modal_enabled && $is_flexible_modal_categories){
345
+
346
+ $acfe_flexible_category = isset($layout['acfe_flexible_category']) ? $layout['acfe_flexible_category'] : '';
347
+
348
+ echo '<li>';
349
+
350
+ echo '<div class="acf-label"><label>Modal Category</label></div>';
351
+
352
+ acf_render_field(array(
353
+ 'prepend' => __('Category'),
354
+ 'name' => 'acfe_flexible_category',
355
+ 'type' => 'text',
356
+ 'class' => 'acf-fc-meta-name',
357
+ 'prefix' => $layout_prefix,
358
+ 'value' => $acfe_flexible_category,
359
+ ));
360
+
361
+ echo '</li>';
362
+
363
+ }
364
+
365
+ if($echo){
366
+ ?>
367
+ <li class="acf-fc-meta-label">
368
+ <div class="acf-label"><label>Settings</label></div>
369
+ <?php
370
+ }
371
+
372
+
373
+ }
374
+
375
+ add_filter('acf/field_wrapper_attributes', 'acfe_flexible_wrapper', 10, 2);
376
+ function acfe_flexible_wrapper($wrapper, $field){
377
+
378
+ if($field['type'] != 'flexible_content')
379
+ return $wrapper;
380
+
381
+ // Stylised button
382
+ if(isset($field['acfe_flexible_stylised_button']) && !empty($field['acfe_flexible_stylised_button'])){
383
+
384
+ $wrapper['data-acfe-flexible-stylised-button'] = 1;
385
+
386
+ }
387
+
388
+ // Hide Empty Message
389
+ if(isset($field['acfe_flexible_hide_empty_message']) && !empty($field['acfe_flexible_hide_empty_message']) || isset($field['acfe_flexible_stylised_button']) && !empty($field['acfe_flexible_stylised_button'])){
390
+
391
+ $wrapper['data-acfe-flexible-hide-empty-message'] = 1;
392
+
393
+ }
394
+
395
+ // Modal
396
+ if(isset($field['acfe_flexible_modal']['acfe_flexible_modal_enabled']) && !empty($field['acfe_flexible_modal']['acfe_flexible_modal_enabled'])){
397
+
398
+ $wrapper['data-acfe-flexible-modal'] = 1;
399
+
400
+ // Columns
401
+ if(isset($field['acfe_flexible_modal']['acfe_flexible_modal_col']) && !empty($field['acfe_flexible_modal']['acfe_flexible_modal_col']))
402
+ $wrapper['data-acfe-flexible-modal-col'] = $field['acfe_flexible_modal']['acfe_flexible_modal_col'];
403
+
404
+ // Title
405
+ if(isset($field['acfe_flexible_modal']['acfe_flexible_modal_title']) && !empty($field['acfe_flexible_modal']['acfe_flexible_modal_title']))
406
+ $wrapper['data-acfe-flexible-modal-title'] = $field['acfe_flexible_modal']['acfe_flexible_modal_title'];
407
+
408
+ }
409
+
410
+ // Layouts State
411
+ if(isset($field['acfe_flexible_layouts_state']) && !empty($field['acfe_flexible_layouts_state'])){
412
+
413
+ // Collapse
414
+ if($field['acfe_flexible_layouts_state'] == 'collapse'){
415
+
416
+ $wrapper['data-acfe-flexible-collapse'] = 1;
417
+
418
+ }
419
+
420
+ // Open
421
+ elseif($field['acfe_flexible_layouts_state'] == 'open'){
422
+
423
+ $wrapper['data-acfe-flexible-open'] = 1;
424
+
425
+ }
426
+
427
+ }
428
+
429
+ return $wrapper;
430
+
431
+ }
432
+
433
+ add_filter('acf/fields/flexible_content/no_value_message', 'acfe_flexible_empty_message', 10, 2);
434
+ function acfe_flexible_empty_message($message, $field){
435
+
436
+ if(!isset($field['acfe_flexible_empty_message']) || empty($field['acfe_flexible_empty_message']))
437
+ return $message;
438
+
439
+ return $field['acfe_flexible_empty_message'];
440
+
441
+ }
442
+
443
+ add_filter('acf/prepare_field/type=flexible_content', 'acfe_flexible_layout_title');
444
+ function acfe_flexible_layout_title($field){
445
+
446
+ if(empty($field['layouts']))
447
+ return $field;
448
+
449
+ foreach($field['layouts'] as $k => &$layout){
450
+
451
+ $thumbnail = false;
452
+ if(isset($field['acfe_flexible_layouts_thumbnails']) && !empty($field['acfe_flexible_layouts_thumbnails'])){
453
+
454
+ $class = $style = array();
455
+ $class[] = 'acfe-flexible-layout-thumbnail';
456
+
457
+ // Modal disabled
458
+ if(!isset($field['acfe_flexible_modal']['acfe_flexible_modal_enabled']) || empty($field['acfe_flexible_modal']['acfe_flexible_modal_enabled']))
459
+ $class[] = 'acfe-flexible-layout-thumbnail-no-modal';
460
+
461
+ // Thumbnail is set
462
+ $thumbnail_found = false;
463
+ if(isset($layout['acfe_flexible_thumbnail']) && !empty($layout['acfe_flexible_thumbnail'])){
464
+
465
+ // Thumbnail exists
466
+ if($thumbnail_src = wp_get_attachment_url($layout['acfe_flexible_thumbnail'])){
467
+
468
+ $thumbnail_found = true;
469
+ $style[] = 'background-image:url(' . $thumbnail_src . ');';
470
+
471
+ }
472
+
473
+ }
474
+
475
+ // Thumbnail not found
476
+ if(!$thumbnail_found){
477
+
478
+ $class[] = 'acfe-flexible-layout-thumbnail-not-found';
479
+
480
+ }
481
+
482
+ $thumbnail = '<div class="' . implode(' ', $class) . '" style="' . implode(' ', $style) . '"></div>';
483
+
484
+ }
485
+
486
+ $category = '';
487
+ if(isset($layout['acfe_flexible_category']) && !empty($layout['acfe_flexible_category'])){
488
+
489
+ $category = 'data-acfe-flexible-category="' . $layout['acfe_flexible_category'] . '"';
490
+
491
+ }
492
+
493
+ $layout['label'] = $thumbnail . '<span '.$category.'>' . $layout['label'] . '</span>';
494
+
495
+ }
496
+
497
+ return $field;
498
+
499
+ }
500
+
501
+ add_filter('acf/fields/flexible_content/layout_title', 'acfe_flexible_layout_title_remove', 0, 4);
502
+ function acfe_flexible_layout_title_remove($title, $field, $layout, $i){
503
+
504
+ // Remove thumbnail
505
+ $title = preg_replace('/<\/?div[^>]*\>/i', '', $title);
506
+
507
+ return $title;
508
+
509
+ }
includes/locations/taxonomy-archive.php CHANGED
@@ -20,6 +20,28 @@ function acfe_location_taxonomy_archive_choices($choices){
20
 
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * ACFE Location: Taxonomy Archive Save
25
  */
20
 
21
  }
22
 
23
+ /**
24
+ * ACFE Location: Fix Native ACF 'Taxonomy == All' Location Matching Taxonomies Archives
25
+ */
26
+ add_filter('acf/location/rule_match/taxonomy', 'acfe_location_taxonomy_archive_fix_all', 10, 4);
27
+ function acfe_location_taxonomy_archive_fix_all($result, $rule, $screen, $field_group){
28
+
29
+ if(!isset($screen['taxonomy']) || empty($screen['taxonomy']))
30
+ return $result;
31
+
32
+ if($rule['operator'] == '==' && $rule['value'] == 'all'){
33
+
34
+ // Current screen taxonomy ends with '_archive'?
35
+ $length = strlen('_archive');
36
+ if(substr($screen['taxonomy'], -$length) === '_archive')
37
+ $result = false;
38
+
39
+ }
40
+
41
+ return $result;
42
+
43
+ }
44
+
45
  /**
46
  * ACFE Location: Taxonomy Archive Save
47
  */
includes/modules/author.php CHANGED
@@ -81,12 +81,12 @@ function acfe_author_field_group(){
81
  acf_add_local_field_group(array(
82
  'title' => __('Author'),
83
  'key' => 'group_acfe_author',
84
- 'menu_order' => 0,
85
  'position' => 'side',
86
  'style' => 'default',
87
  'label_placement' => 'top',
88
  'instruction_placement' => 'label',
89
- 'hide_on_screen' => array(),
90
  'active' => 1,
91
  'description' => '',
92
  'location' => $locations,
81
  acf_add_local_field_group(array(
82
  'title' => __('Author'),
83
  'key' => 'group_acfe_author',
84
+ 'menu_order' => 99999,
85
  'position' => 'side',
86
  'style' => 'default',
87
  'label_placement' => 'top',
88
  'instruction_placement' => 'label',
89
+ 'hide_on_screen' => '',
90
  'active' => 1,
91
  'description' => '',
92
  'location' => $locations,
includes/modules/taxonomy.php CHANGED
@@ -82,6 +82,8 @@ function acfe_better_taxonomy_admin_footer(){
82
  });
83
  }
84
 
 
 
85
  })(jQuery);
86
  </script>
87
  <?php
82
  });
83
  }
84
 
85
+ $('#acfe-bt-form .acf-tab-wrap.-left').removeClass('-left').addClass('-top');
86
+
87
  })(jQuery);
88
  </script>
89
  <?php
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: acf, custom fields, meta, admin, fields, form, repeater, content
5
  Requires at least: 4.9
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
- Stable tag: 0.6.7.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -176,9 +176,26 @@ Manage ACF Block Types from ACF > Block Types.
176
  * All arguments are available
177
  * Requires ACF Pro 5.8
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  == ❤️ Supporters ==
180
 
181
- * Thanks to [Brandon A.](https://twitter.com/AsmussenBrandon) for his continuous support & tests
 
 
182
 
183
  == 🛠️ Links ==
184
 
@@ -231,19 +248,55 @@ Usage example:
231
 
232
  * The page is now also saved in the said post relationship field
233
 
 
 
 
 
 
 
 
 
 
 
234
  == Screenshots ==
235
 
236
  1. Field Groups List
237
- 2. Field Groups List (Labeled)
238
- 3. Field Group
239
- 4. Field Group (Labeled)
240
- 5. Field Group: Raw Data (Modal)
241
- 6. Field
242
- 7. Field: Raw Data (Modal)
243
- 8. ACF Settings
 
 
244
 
245
  == Changelog ==
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  = 0.6.7.2 =
248
  * Field Group: Latest Post Type 'All' location fix was too sensitive. The location now works as expected
249
  * Module: Dynamic Post Types, Taxonomies & Block Types modules now set the 'slug' as disabled once it's saved (to avoid duplication). A more flexible solution will be introduced later (WIP)
@@ -277,7 +330,7 @@ Usage example:
277
 
278
  = 0.6.0.1 =
279
  * General: Fixed backward compatibility for ACF Pro 5.7.10. The function: acf_add_filter_variations() was causing problems.
280
- * Admin: Temporarily removed the 'Options Beta' admin screen. Still needs some works.
281
 
282
  = 0.6 =
283
  * Field Group: New location available - Post type archive (under Post type). Field group will be displayed on post type list view, as a sidebar. Fields will be saved in the option: `{post_type}_options`. Frontend usage example: `get_field('my_field', 'page_options')`.
5
  Requires at least: 4.9
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
+ Stable tag: 0.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
176
  * All arguments are available
177
  * Requires ACF Pro 5.8
178
 
179
+ = ACF: Flexible Content Enhancement =
180
+
181
+ * Stylised Button: Add style to 'Add Row'
182
+ * Hide Empty Message: Hide the native Flexible Content 'Empty' message
183
+ * Empty Message: Change the native Flexible Content 'Click the Add Row button below...' message
184
+ * Layouts Thumbnails: Add thumbnails for each layout in the layout selection
185
+ * Layouts Render: Add `template.php`, `style.css` & `script.js` files settings for each layout. Those settings can be then accessed in the front-end ([More informations in the FAQ](#faq))
186
+ * Modal: Change the layout selection into a proper modal in the administration
187
+ * Modal: Title: Change the layout modal title
188
+ * Modal: Columns: Change the layout modal columns grid. 1, 2, 3, 4, 5 or 6 columns available
189
+ * Modal: Categories: Add category for each layout in the layout modal
190
+ * Layouts State: Force layouts to be collapsed or opened by default
191
+ * Button Label: Natively supports Dashicons HTML `<span>`
192
+ * One click: the 'Add row' button will add a layout without the selection modal if there is only one layout available in the flexible content
193
+
194
  == ❤️ Supporters ==
195
 
196
+ * Thanks to [Brandon A.](https://twitter.com/AsmussenBrandon) for his support & tests
197
+ * Thanks to [Damien C.](https://twitter.com/DamChtlv) for his support & tests
198
+ * Thanks to [Valentin P.](https://twitter.com/Val_Pellegrin) for his support & tests
199
 
200
  == 🛠️ Links ==
201
 
248
 
249
  * The page is now also saved in the said post relationship field
250
 
251
+ = How to use Flexible Content templates, styles & scripts? =
252
+
253
+ Templates, styles & scripts settings are saved in each layouts. They can be accessed manually via `get_field('my_flexible')` for example.
254
+
255
+ The settings use the following keys: `acfe_flexible_render_template`, `acfe_flexible_render_style` and `acfe_flexible_render_script`.
256
+
257
+ ACF Extended has two functions which will automatically include those files: `get_flexible($selector, $post_id)` and `the_flexible($selector, $post_id)` (`$post_id` is optional).
258
+
259
+ Usage example: `echo get_flexible('my_flexible');`.
260
+
261
  == Screenshots ==
262
 
263
  1. Field Groups List
264
+ 2. Field Group
265
+ 3. Flexible Content Modal
266
+ 4. Flexible Content Settings
267
+ 5. Dynamic Post Type
268
+ 6. Dynamic Taxonomy
269
+ 7. Dynamic Options Pages
270
+ 8. Dynamic Block Types
271
+ 9. Field
272
+ 10. ACF Settings
273
 
274
  == Changelog ==
275
 
276
+ = 0.7 =
277
+ * Field: Flexible Content - Added 'Stylised Button' setting which automatically hide native ACF 'empty' message and add style to 'Add row' button
278
+ * Field: Flexible Content - Added 'Hide Empty Message' setting to hide native ACF 'empty' message
279
+ * Field: Flexible Content - Added 'Empty Message' text setting to change the native ACF 'click the Add Row button below...' message
280
+ * Field: Flexible Content - Added 'Layouts Thumbnails' setting to add image thumbnails for each layout in the admin layout selection
281
+ * Field: Flexible Content - Added 'Layouts Render' setting to add template, style & script file for each layout. Those settings can be then accessed on the front-end
282
+ * Field: Flexible Content - Added `get_flexible($selector, $post_id)` and `the_flexible($selector, $post_id)` functions to automatically use the 'Layouts Render' settings in front-end
283
+ * Field: Flexible Content - Added 'Modal' setting to change the layout selection into a proper modal in the administration
284
+ * Field: Flexible Content - Added 'Modal: Title' setting to change the layout modal title
285
+ * Field: Flexible Content - Added 'Modal: Columns' setting to change the layout modal columns grid. 1, 2, 3, 4, 5 or 6 columns available
286
+ * Field: Flexible Content - Added 'Modal: Categories' setting to add a category for each layout in the layout modal
287
+ * Field: Flexible Content - Added 'Layouts State' setting to force layouts to be collapsed or opened by default
288
+ * Field: Flexible Content - Added 'Button Label' native compatibility fix to make it work with Dashicons (CSS to fix vertical alignment)
289
+ * Field: Flexible Content - Added 'One click' hidden function. In the post administration, the 'Add row' button will add a layout without the selection modal if there is only one layout available in the flexible content
290
+ * Field: Flexible Content - Note - The following settings: Layouts Thumbnails, Layouts Render & Modal Categories will be visible after saving field group
291
+ * Module: Ajax Author - Fixed a bug where field groups 'Hide on screen' setting wasn't applied on post administration
292
+ * Module: Json AutoSync - Added "'/acf-json' folder not found" warning message if Json Sync is set in a field group and the '/acf-json' folder doesn't exists
293
+ * Module: Taxonomy - Forced Tabs to be 'Aligned Top' in taxonomies fields (JS Only - ACF Bug) & added better CSS style (thanks to @Val_Pellegrin)
294
+ * Module: Dynamic Post Type/Taxonomy/Option Page/Block Type - Hidden 'Minor publishing' panel (Save as draft, visibility...) to avoid confusion (thanks to @Val_Pellegrin)
295
+ * Field: Bidirectional - Removed the 'bail early if old values == new values' check. This will let users convert existing fields with saved values into bidirectional without hassle (thanks to @Val_Pellegrin)
296
+ * Field: Repeater - Added CSS spacing for block repeaters (better readability)
297
+ * Field Group: Location 'Taxonomy All' - Fix native ACF location 'Taxonomy == All' matching all ACF Extended 'Taxonomies Archives' locations
298
+ * Compatibility: Added compatibility fix for Rank Math SEO & YOAST Plugin to avoid the plugin's post metabox being above ACF metaboxes
299
+
300
  = 0.6.7.2 =
301
  * Field Group: Latest Post Type 'All' location fix was too sensitive. The location now works as expected
302
  * Module: Dynamic Post Types, Taxonomies & Block Types modules now set the 'slug' as disabled once it's saved (to avoid duplication). A more flexible solution will be introduced later (WIP)
330
 
331
  = 0.6.0.1 =
332
  * General: Fixed backward compatibility for ACF Pro 5.7.10. The function: acf_add_filter_variations() was causing problems.
333
+ * Admin: Temporarily removed the 'Options Beta' admin screen. Still needs some works. (thanks to @DamChtlv)
334
 
335
  = 0.6 =
336
  * Field Group: New location available - Post type archive (under Post type). Field group will be displayed on post type list view, as a sidebar. Fields will be saved in the option: `{post_type}_options`. Frontend usage example: `get_field('my_field', 'page_options')`.