PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / 0.9.0.7
Advanced Custom Fields: Extended v0.9.0.7
0.9.2.6 0.9.2.5 0.8.6 0.8.6.1 0.8.6.3 0.8.6.5 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.8 0.8.8.1 0.8.8.10 0.8.8.11 0.8.8.2 0.8.8.3 0.8.8.4 0.8.8.5 0.8.8.6 0.8.8.7 0.8.8.8 0.8.8.9 0.8.9 0.8.9.1 0.8.9.2 0.8.9.3 0.8.9.4 0.8.9.5 0.9 0.9.0.1 0.9.0.2 0.9.0.3 0.9.0.4 0.9.0.5 0.9.0.6 0.9.0.7 0.9.0.8 0.9.0.9 0.9.1 0.9.1.1 0.9.2 0.9.2.1 0.9.2.2 0.9.2.3 0.9.2.4 trunk 0.5 0.5.1 0.5.2 0.5.2.1 0.5.2.3 0.5.5 0.5.5.1 0.5.8 0.5.8.1 0.6 0.6.0.1 0.6.0.2 0.6.1 0.6.3 0.6.5 0.6.7 0.6.7.2 0.7 0.7.0.3 0.7.5 0.7.5.5 0.7.8 0.7.9 0.7.9.3 0.7.9.4 0.7.9.9.8 0.7.9.9.9 0.8 0.8.1 0.8.2 0.8.3 0.8.3.1 0.8.4 0.8.4.1 0.8.4.5 0.8.4.6 0.8.5 0.8.5.5
acf-extended / includes / compatibility.php
acf-extended / includes Last commit date
admin 2 years ago field-groups 2 years ago fields 2 years ago fields-settings 2 years ago locations 3 years ago modules 1 year ago screens 2 years ago acfe-deprecated-functions.php 2 years ago acfe-field-functions.php 2 years ago acfe-field-group-functions.php 2 years ago acfe-file-functions.php 3 years ago acfe-form-functions.php 2 years ago acfe-helper-functions.php 2 years ago acfe-meta-functions.php 3 years ago acfe-post-functions.php 3 years ago acfe-screen-functions.php 3 years ago acfe-template-functions.php 2 years ago acfe-term-functions.php 3 years ago acfe-user-functions.php 3 years ago acfe-wp-functions.php 3 years ago assets.php 2 years ago compatibility-6.0.php 2 years ago compatibility.php 2 years ago field-extend.php 3 years ago field.php 3 years ago hooks.php 3 years ago init.php 3 years ago local-meta.php 3 years ago module-acf.php 2 years ago module-db.php 3 years ago module-l10n.php 2 years ago module-legacy.php 3 years ago module-manager.php 3 years ago module-post.php 2 years ago module-posts.php 2 years ago module-upgrades.php 3 years ago module.php 2 years ago multilang.php 3 years ago settings.php 3 years ago template-tags.php 2 years ago third-party.php 3 years ago upgrades.php 3 years ago
compatibility.php
473 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_compatibility')):
8
9 class acfe_compatibility{
10
11 /**
12 * construct
13 */
14 function __construct(){
15
16 // global
17 add_action('acf/init', array($this, 'acf_init'), 98);
18 add_action('acfe/init', array($this, 'acfe_init'), 99);
19
20 // fields
21 add_filter('acf/validate_field_group', array($this, 'field_group_location_list'), 20);
22 add_filter('acf/validate_field_group', array($this, 'field_group_instruction_tooltip'), 20);
23 add_filter('acf/validate_field', array($this, 'field_acfe_update'), 20);
24 add_filter('acf/validate_field/type=group', array($this, 'field_seamless_style'), 20);
25 add_filter('acf/validate_field/type=clone', array($this, 'field_seamless_style'), 20);
26 add_filter('acf/validate_field/type=acfe_dynamic_message', array($this, 'field_dynamic_message'), 20);
27 add_filter('acf/validate_field/type=acfe_column', array($this, 'field_column'), 20);
28 add_filter('acf/validate_field/type=image', array($this, 'field_image'), 20);
29 add_filter('acf/validate_field/type=file', array($this, 'field_image'), 20);
30 add_filter('acf/validate_field/type=acfe_forms', array($this, 'field_forms'), 20);
31 add_filter('acf/validate_field/type=acfe_code_editor', array($this, 'field_code_editor'), 20);
32 add_filter('acfe/load_fields/type=flexible_content', array($this, 'field_flexible_settings_title'), 20, 2);
33 add_filter('acf/prepare_field/name=acfe_flexible_category', array($this, 'field_flexible_layout_categories'), 10, 2);
34
35 }
36
37
38 /**
39 * acf_init
40 *
41 * acf/init:98
42 *
43 * Rename modules
44 *
45 * @since 0.8 (20/10/2019)
46 */
47 function acf_init(){
48
49 // settings list
50 $settings = array(
51 'acfe_php' => 'acfe/php',
52 'php_save' => 'acfe/php_save',
53 'php_load' => 'acfe/php_load',
54 'php_found' => 'acfe/php_found',
55 'acfe/modules/dynamic_block_types' => 'acfe/modules/block_types',
56 'acfe/modules/dynamic_forms' => 'acfe/modules/forms',
57 'acfe/modules/dynamic_options_pages' => 'acfe/modules/options_pages',
58 'acfe/modules/dynamic_post_types' => 'acfe/modules/post_types',
59 'acfe/modules/dynamic_taxonomies' => 'acfe/modules/taxonomies',
60 );
61
62 // loop settings
63 foreach($settings as $old => $new){
64
65 // get old setting 'acfe_php'
66 $value = acf_get_setting($old);
67
68 if($value !== null){
69
70 // deprecated notice
71 acfe_deprecated_setting($old, '0.8', $new);
72
73 // update setting
74 acf_update_setting($new, $value);
75
76 }
77
78 }
79
80 }
81
82
83
84 /**
85 * acfe_init
86 *
87 * acfe/init:99
88 *
89 * @since 0.8.9.3 (03/2023)
90 */
91 function acfe_init(){
92
93 // get old setting
94 $setting = acf_get_setting('acfe/modules/single_meta');
95
96 if($setting !== null){
97
98 // deprecated notice
99 acfe_deprecated_setting('acfe/modules/single_meta', '0.8.9.3', 'acfe/modules/performance');
100
101 // update setting
102 if($setting){
103 acf_update_setting('acfe/modules/performance', 'ultra');
104 }
105
106 }
107
108 }
109
110
111 /**
112 * field_group_location_list
113 *
114 * acf/validate_field_group:20
115 *
116 * Field Group Location: Archive renamed to List
117 *
118 * @since 0.8 (20/10/2019)
119 */
120 function field_group_location_list($field_group){
121
122 if(!acf_maybe_get($field_group, 'location')){
123 return $field_group;
124 }
125
126 foreach($field_group['location'] as &$or){
127
128 foreach($or as &$and){
129
130 if(!isset($and['value'])){
131 continue;
132 }
133
134 // post type list
135 // replace old 'my-post-type_archive'
136 if($and['param'] === 'post_type' && acfe_ends_with($and['value'], '_archive')){
137
138 $and['param'] = 'post_type_list';
139 $and['value'] = substr_replace($and['value'], '', -8);
140
141 // taxonomy list
142 // replace old 'my-taxonomy_archive'
143 }elseif($and['param'] === 'taxonomy' && acfe_ends_with($and['value'], '_archive')){
144
145 $and['param'] = 'taxonomy_list';
146 $and['value'] = substr_replace($and['value'], '', -8);
147
148 }
149
150 }
151
152 }
153
154 return $field_group;
155
156 }
157
158 /**
159 * field_group_instruction_tooltip
160 *
161 * Tooltip old parameter name compatibility
162 *
163 * @param $field_group
164 *
165 * @since 0.8.7.5 (11/12/2020)
166 *
167 * @return mixed
168 */
169 function field_group_instruction_tooltip($field_group){
170
171 if(acf_maybe_get($field_group, 'instruction_placement') === 'acfe_instructions_tooltip'){
172 $field_group['instruction_placement'] = 'tooltip';
173 }
174
175 return $field_group;
176
177 }
178
179
180 /**
181 * field_acfe_update
182 *
183 * acf/validate_field:20
184 *
185 * Field Filter Value: Removed
186 *
187 * @since 0.8 (20/10/2019)
188 */
189 function field_acfe_update($field){
190
191 if(isset($field['acfe_update'])){
192 unset($field['acfe_update']);
193 }
194
195 return $field;
196
197 }
198
199
200 /**
201 * field_seamless_style
202 *
203 * acf/validate_field/type=group:20
204 * acf/validate_field/type=clone:20
205 *
206 * Field Group/Clone: Fixed typo 'Seamless'
207 *
208 * @since 0.8.5 (15/03/2020)
209 */
210 function field_seamless_style($field){
211
212 if($seamless = acf_maybe_get($field, 'acfe_seemless_style', false)){
213 $field['acfe_seamless_style'] = $seamless;
214 unset($field['acfe_seemless_style']);
215 }
216
217 return $field;
218
219 }
220
221
222 /**
223 * field_dynamic_message
224 *
225 * acf/validate_field/type=acfe_dynamic_message:20
226 *
227 * Renamed 'Dynamic Message' field to 'Dynamic Render'
228 *
229 * @since 0.8.8.5 (03/09/2021)
230 */
231 function field_dynamic_message($field){
232
233 $field['type'] = 'acfe_dynamic_render';
234
235 return $field;
236
237 }
238
239
240 /**
241 * field_column
242 *
243 * acf/validate_field/type=acfe_column:20
244 *
245 * Changed columns to 12 grid instead of 6
246 *
247 * @since 0.8.7.3 (29/09/2020)
248 */
249 function field_column($field){
250
251 if(acfe_ends_with($field['columns'], '/6')){
252
253 switch($field['columns']){
254
255 case '1/6': {
256 $field['columns'] = '2/12';
257 break;
258 }
259
260 case '2/6': {
261 $field['columns'] = '4/12';
262 break;
263 }
264
265 case '3/6': {
266 $field['columns'] = '6/12';
267 break;
268 }
269
270 case '4/6': {
271 $field['columns'] = '8/12';
272 break;
273 }
274
275 case '5/6': {
276 $field['columns'] = '10/12';
277 break;
278 }
279
280 case '6/6': {
281 $field['columns'] = '12/12';
282 break;
283 }
284
285 }
286
287 }
288
289 return $field;
290
291 }
292
293
294 /**
295 * field_image
296 *
297 * acf/validate_field/type=image:20
298 * acf/validate_field/type=file:20
299 *
300 * Renamed setting 'acfe_uploader' to 'uploader' for image & file
301 *
302 * @since 0.8.7.5 (11/12/2020)
303 */
304 function field_image($field){
305
306 if(acf_maybe_get($field, 'acfe_uploader')){
307
308 $field['uploader'] = $field['acfe_uploader'];
309 unset($field['acfe_uploader']);
310
311 }
312
313 return $field;
314
315 }
316
317
318 /**
319 * field_forms
320 *
321 * acf/validate_field/type=forms:20
322 *
323 * 'forms' argument should return names and not id anymore
324 *
325 * @since 0.9 (07/02/2024)
326 */
327 function field_forms($field){
328
329 if(!is_array($field['forms']) || empty($field['forms']) || !is_numeric($field['forms'][0])){
330 return $field;
331 }
332
333 // loop allowed forms
334 foreach(array_keys($field['forms']) as $k){
335
336 // value
337 $value = $field['forms'][ $k ];
338
339 // deprecated return form id
340 // we need to return form name
341 if(is_numeric($value)){
342
343 // get item
344 $item = acfe_get_module('form')->get_item($value);
345
346 // found item by ID
347 // return name
348 if($item){
349 $field['forms'][ $k ] = $item['name'];
350
351 // not found
352 // remove
353 }else{
354 unset($field['forms'][ $k ]);
355 }
356
357 }
358
359 }
360
361 return $field;
362
363 }
364
365
366 /**
367 * field_code_editor
368 *
369 * acf/validate_field/type=acfe_code_editor:20
370 *
371 * Renamed 'return_entities' to 'return_format' for code editor
372 *
373 * @since 0.8.9.1
374 *
375 * @param $field
376 */
377 function field_code_editor($field){
378
379 if(acf_maybe_get($field, 'return_entities')){
380
381 if(!in_array('htmlentities', $field['return_format'])){
382 $field['return_format'][] = 'htmlentities';
383 }
384
385 unset($field['return_entities']);
386
387 }
388
389 return $field;
390
391 }
392
393
394 /**
395 * field_flexible_settings_title
396 *
397 * acfe/load_fields/type=flexible_content:20
398 *
399 * Field Flexible Content: Fix duplicated "layout_settings" & "layout_title"
400 *
401 * @since 0.8.4.5 (11/02/2020)
402 */
403 function field_flexible_settings_title($fields, $parent){
404
405 // Check if is tool screen
406 if(!acf_is_screen(acfe_get_acf_screen_id('acf-tools'))){
407 return $fields;
408 }
409
410 foreach($fields as $_k => $_field){
411
412 // field name
413 $_field_name = acf_maybe_get($_field, 'name');
414
415 // check 'acfe_flexible_layout_title' & 'layout_settings'
416 if($_field_name !== 'acfe_flexible_layout_title' && $_field_name !== 'layout_settings'){
417 continue;
418 }
419
420 // unset
421 unset($fields[$_k]);
422
423 }
424
425 return $fields;
426
427 }
428
429
430 /**
431 * field_flexible_layout_categories
432 *
433 * acf/prepare_field/name=acfe_flexible_category
434 *
435 * Field Flexible Content: Compatibility for Layout Categories
436 *
437 * @since 0.8.6.7 (16/07/2020)
438 */
439 function field_flexible_layout_categories($field){
440
441 $value = acf_maybe_get($field, 'value');
442
443 if(empty($value)){
444 return $field;
445 }
446
447 if(is_string($value)){
448
449 $explode = explode('|', $value);
450
451 $choices = array();
452
453 foreach($explode as $v){
454
455 $v = trim($v);
456 $choices[ $v ] = $v;
457
458 }
459
460 $field['choices'] = $choices;
461 $field['value'] = $choices;
462
463 }
464
465 return $field;
466
467 }
468
469 }
470
471 new acfe_compatibility();
472
473 endif;