Version Description
- Field: Flexible Content - Added
filter('acfe/flexible/thumbnail/name={flexible:name}', $thumbnail, $field, $layout)
to change all layouts thumbnails (must returnattachment ID
orURL
) (Thanks @Dam) - Field: Flexible Content - Fixed
$is_preview
not being available during the Dynamic Layout Preview (thanks @Dam) - Module: Author Box - Added custom authors roles being able to be selected in the Author Box (Thanks @Andremacola)
- General: Fixed Readme typos
Download this release
Release Info
Developer | hwk-fr |
Plugin | Advanced Custom Fields: Extended |
Version | 0.7.9.3 |
Comparing to | |
See all releases |
Code changes from version 0.7.9 to 0.7.9.3
- acf-extended.php +1 -1
- includes/fields-settings/flexible-content.php +11 -1
- includes/modules/author.php +14 -1
- readme.txt +31 -22
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.7.9
|
6 |
* Author: ACF Extended
|
7 |
* Author URI: https://www.acf-extended.com
|
8 |
* Text Domain: acfe
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
+
* Version: 0.7.9.3
|
6 |
* Author: ACF Extended
|
7 |
* Author URI: https://www.acf-extended.com
|
8 |
* Text Domain: acfe
|
includes/fields-settings/flexible-content.php
CHANGED
@@ -621,6 +621,10 @@ function acfe_flexible_layout_title_prepare($field){
|
|
621 |
$acfe_flexible_thumbnail = $layout['acfe_flexible_thumbnail'];
|
622 |
|
623 |
// Filter: acfe/flexible/layout/thumbnail/name={field:flexible:name}&layout={field:flexible:layout_name}
|
|
|
|
|
|
|
|
|
624 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
625 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
626 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
@@ -742,7 +746,11 @@ function acfe_flexible_layout_preview(){
|
|
742 |
if(!$layout)
|
743 |
die;
|
744 |
|
745 |
-
//
|
|
|
|
|
|
|
|
|
746 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
747 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
748 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
@@ -788,6 +796,8 @@ function acfe_flexible_layout_preview(){
|
|
788 |
add_action('acfe/flexible/preview', 'acfe_flexible_layout_preview_render', 99, 2);
|
789 |
function acfe_flexible_layout_preview_render($field, $layout){
|
790 |
|
|
|
|
|
791 |
$is_preview = true;
|
792 |
|
793 |
acfe_flexible_render_layout_template($layout, $field);
|
621 |
$acfe_flexible_thumbnail = $layout['acfe_flexible_thumbnail'];
|
622 |
|
623 |
// Filter: acfe/flexible/layout/thumbnail/name={field:flexible:name}&layout={field:flexible:layout_name}
|
624 |
+
// Flexible Thumbnails
|
625 |
+
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/thumbnail/name=' . $field['_name'], $acfe_flexible_thumbnail, $field, $layout);
|
626 |
+
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/thumbnail/key=' . $field['key'], $acfe_flexible_thumbnail, $field, $layout);
|
627 |
+
|
628 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
629 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
630 |
$acfe_flexible_thumbnail = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $acfe_flexible_thumbnail, $field, $layout);
|
746 |
if(!$layout)
|
747 |
die;
|
748 |
|
749 |
+
// Flexible Thumbnails
|
750 |
+
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/thumbnail/name=' . $field['_name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
751 |
+
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/thumbnail/key=' . $field['key'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
752 |
+
|
753 |
+
// Layout Thumbnails
|
754 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
755 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
756 |
$layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
|
796 |
add_action('acfe/flexible/preview', 'acfe_flexible_layout_preview_render', 99, 2);
|
797 |
function acfe_flexible_layout_preview_render($field, $layout){
|
798 |
|
799 |
+
global $is_preview;
|
800 |
+
|
801 |
$is_preview = true;
|
802 |
|
803 |
acfe_flexible_render_layout_template($layout, $field);
|
includes/modules/author.php
CHANGED
@@ -78,6 +78,19 @@ function acfe_author_field_group(){
|
|
78 |
);
|
79 |
}
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
acf_add_local_field_group(array(
|
82 |
'title' => __('Author'),
|
83 |
'key' => 'group_acfe_author',
|
@@ -102,7 +115,7 @@ function acfe_author_field_group(){
|
|
102 |
'allow_null' => 0,
|
103 |
'multiple' => 0,
|
104 |
'return_format' => 'array',
|
105 |
-
'role' =>
|
106 |
'wrapper' => array(
|
107 |
'width' => '',
|
108 |
'class' => '',
|
78 |
);
|
79 |
}
|
80 |
|
81 |
+
// Roles
|
82 |
+
global $wp_roles;
|
83 |
+
|
84 |
+
$authors_roles = array();
|
85 |
+
foreach($wp_roles->roles as $role){
|
86 |
+
|
87 |
+
if(!isset($role['capabilities']['level_1']) || empty($role['capabilities']['level_1']))
|
88 |
+
continue;
|
89 |
+
|
90 |
+
$authors_roles[] = $role['name'];
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
acf_add_local_field_group(array(
|
95 |
'title' => __('Author'),
|
96 |
'key' => 'group_acfe_author',
|
115 |
'allow_null' => 0,
|
116 |
'multiple' => 0,
|
117 |
'return_format' => 'array',
|
118 |
+
'role' => $authors_roles,
|
119 |
'wrapper' => array(
|
120 |
'width' => '',
|
121 |
'class' => '',
|
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.7.9
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -284,15 +284,18 @@ When using this function, you have access to the following global variables: `$l
|
|
284 |
You can use the following filters:
|
285 |
|
286 |
`
|
287 |
-
//
|
288 |
-
//
|
|
|
|
|
|
|
289 |
|
290 |
add_filter('acfe/flexible/layout/thumbnail/layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
|
291 |
function acf_flexible_layout_thumbnail($thumbnail, $field, $layout){
|
292 |
|
293 |
|
294 |
// Must return an URL or Attachment ID
|
295 |
-
return 'https://www.example.com/my-image
|
296 |
|
297 |
}
|
298 |
`
|
@@ -374,12 +377,12 @@ function acf_flexible_layout_enqueue($field, $layout, $is_preview){
|
|
374 |
You can use the following actions:
|
375 |
|
376 |
`
|
377 |
-
//
|
378 |
-
//
|
379 |
-
//
|
380 |
|
381 |
-
//
|
382 |
-
//
|
383 |
|
384 |
add_filter('acfe/flexible/layout/render/template/layout=my_layout', 'acf_flexible_layout_render_template', 10, 4);
|
385 |
function acf_flexible_layout_render_template($template, $field, $layout, $is_preview){
|
@@ -395,12 +398,12 @@ function acf_flexible_layout_render_template($template, $field, $layout, $is_pre
|
|
395 |
|
396 |
}
|
397 |
|
398 |
-
//
|
399 |
-
//
|
400 |
-
//
|
401 |
|
402 |
-
//
|
403 |
-
//
|
404 |
|
405 |
add_filter('acfe/flexible/layout/render/style/layout=my_layout', 'acf_flexible_layout_render_style', 10, 4);
|
406 |
function acf_flexible_layout_render_style($style, $field, $layout, $is_preview){
|
@@ -416,12 +419,12 @@ function acf_flexible_layout_render_style($style, $field, $layout, $is_preview){
|
|
416 |
|
417 |
}
|
418 |
|
419 |
-
//
|
420 |
-
//
|
421 |
-
//
|
422 |
|
423 |
-
//
|
424 |
-
//
|
425 |
|
426 |
add_filter('acfe/flexible/layout/render/script/layout=my_layout', 'acf_flexible_layout_render_script', 10, 4);
|
427 |
function acf_flexible_layout_render_script($script, $field, $layout, $is_preview){
|
@@ -453,15 +456,21 @@ function acf_flexible_layout_render_script($script, $field, $layout, $is_preview
|
|
453 |
|
454 |
== Changelog ==
|
455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
= 0.7.9 =
|
457 |
* Field: Flexible Content - Added Inline Layout Title Edition
|
458 |
* Field: Flexible Content - Added Auto scroll + Modal edit on One Click layout
|
459 |
* Field: Flexible Content - Removed native "Controls Icons" visibility being visible on all sub flexible content fields (better readability)
|
460 |
* Field: Flexible Content - Added WP Unslash on preview values to prevent backlashes on values (thanks @Dam)
|
461 |
* Field: Flexible Content - Added compatibility for layouts that have been synced and not manually created (thanks @T. Dubois)
|
462 |
-
* Field: Flexible Content - Copy/Paste functionality is now a Flexible Content setting (Default: Disabled) (Feature
|
463 |
* Field: Flexible Content - 'Close Button' (collapse) on layouts is now a Flexible Content setting(Default: Disabled)
|
464 |
-
* Field: Flexible Content - Layouts Thumbnails aspect ratio are now locked (base ratio: 450px * 200px) (Feature
|
465 |
* Field: Flexible Content - Dynamic Layout Preview refresh has been optimized. The preview content is now kept instead of being reset
|
466 |
* Field: Flexible Content - Dynamic Layout Preview style & script enqueue now use wp_enqueue_style() & wp_enqueue_script()
|
467 |
* Field: Flexible Content - Modal Edition - 'Enter' & 'ESC' keys now close Modals (instead of submitting the form)
|
@@ -472,7 +481,7 @@ function acf_flexible_layout_render_script($script, $field, $layout, $is_preview
|
|
472 |
* Field: Flexible Content - Added `filter('acfe/flexible/render/style', $style, $field, $layout, $is_preview)` to change Layout Render: Style Path (with 6 variations)
|
473 |
* Field: Flexible Content - Added `filter('acfe/flexible/render/script', $script, $field, $layout, $is_preview)` to change Layout Render: Script Path (with 6 variations)
|
474 |
* Field: Flexible Content - Added `filter('acfe/flexible/placeholder/icon', $class, $field)` to change the Placeholder Button Dashicon class (default: 'dashicons dashicons-edit') (with 3 variations)
|
475 |
-
* Module: Dynamic Options Page - Fixed '
|
476 |
* Module: Dynamic Options Page - Fixed registration order for child options pages (thanks @Val)
|
477 |
* Module: Dynamic Post Type - Fixed undefined ID php Warning on edit screen when Dynamic Post Type is registered locally (thanks @Val)
|
478 |
* Module: Dynamic Taxonomies - Taxonomy name character limit has been fixed to 32 instead of 20 (thanks @Damian)
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.2
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 0.7.9.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
284 |
You can use the following filters:
|
285 |
|
286 |
`
|
287 |
+
// add_filter('acfe/flexible/thumbnail/name=my_flexible', 'acf_flexible_layout_thumbnail', 10, 3);
|
288 |
+
// add_filter('acfe/flexible/thumbnail/key=field_xxxxxx', 'acf_flexible_layout_thumbnail', 10, 3);
|
289 |
+
|
290 |
+
// add_filter('acfe/flexible/layout/thumbnail/name=my_flexible&layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
|
291 |
+
// add_filter('acfe/flexible/layout/thumbnail/key=field_xxxxxx&layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
|
292 |
|
293 |
add_filter('acfe/flexible/layout/thumbnail/layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
|
294 |
function acf_flexible_layout_thumbnail($thumbnail, $field, $layout){
|
295 |
|
296 |
|
297 |
// Must return an URL or Attachment ID
|
298 |
+
return 'https://www.example.com/my-image.jpg';
|
299 |
|
300 |
}
|
301 |
`
|
377 |
You can use the following actions:
|
378 |
|
379 |
`
|
380 |
+
// add_filter('acfe/flexible/render/template', 'acf_flexible_layout_render_template', 10, 4);
|
381 |
+
// add_filter('acfe/flexible/render/template/name=my_flexible', 'acf_flexible_layout_render_template', 10, 4);
|
382 |
+
// add_filter('acfe/flexible/render/template/key=field_xxxxxx', 'acf_flexible_layout_render_template', 10, 4);
|
383 |
|
384 |
+
// add_filter('acfe/flexible/layout/render/template/name=my_flexible&layout=my_layout', 'acf_flexible_layout_render_template', 10, 4);
|
385 |
+
// add_filter('acfe/flexible/layout/render/template/key=field_xxxxxx&layout=my_layout', 'acf_flexible_layout_render_template', 10, 4);
|
386 |
|
387 |
add_filter('acfe/flexible/layout/render/template/layout=my_layout', 'acf_flexible_layout_render_template', 10, 4);
|
388 |
function acf_flexible_layout_render_template($template, $field, $layout, $is_preview){
|
398 |
|
399 |
}
|
400 |
|
401 |
+
// add_filter('acfe/flexible/render/style', 'acf_flexible_layout_render_style', 10, 4);
|
402 |
+
// add_filter('acfe/flexible/render/style/name=my_flexible', 'acf_flexible_layout_render_style', 10, 4);
|
403 |
+
// add_filter('acfe/flexible/render/style/key=field_xxxxxx', 'acf_flexible_layout_render_style', 10, 4);
|
404 |
|
405 |
+
// add_filter('acfe/flexible/layout/render/style/name=my_flexible&layout=my_layout', 'acf_flexible_layout_render_style', 10, 4);
|
406 |
+
// add_filter('acfe/flexible/layout/render/style/key=field_xxxxxx&layout=my_layout', 'acf_flexible_layout_render_style', 10, 4);
|
407 |
|
408 |
add_filter('acfe/flexible/layout/render/style/layout=my_layout', 'acf_flexible_layout_render_style', 10, 4);
|
409 |
function acf_flexible_layout_render_style($style, $field, $layout, $is_preview){
|
419 |
|
420 |
}
|
421 |
|
422 |
+
// add_filter('acfe/flexible/render/script', 'acf_flexible_layout_render_script', 10, 4);
|
423 |
+
// add_filter('acfe/flexible/render/script/name=my_flexible', 'acf_flexible_layout_render_script', 10, 4);
|
424 |
+
// add_filter('acfe/flexible/render/script/key=field_xxxxxx', 'acf_flexible_layout_render_script', 10, 4);
|
425 |
|
426 |
+
// add_filter('acfe/flexible/layout/render/script/name=my_flexible&layout=my_layout', 'acf_flexible_layout_render_script', 10, 4);
|
427 |
+
// add_filter('acfe/flexible/layout/render/script/key=field_xxxxxx&layout=my_layout', 'acf_flexible_layout_render_script', 10, 4);
|
428 |
|
429 |
add_filter('acfe/flexible/layout/render/script/layout=my_layout', 'acf_flexible_layout_render_script', 10, 4);
|
430 |
function acf_flexible_layout_render_script($script, $field, $layout, $is_preview){
|
456 |
|
457 |
== Changelog ==
|
458 |
|
459 |
+
= 0.7.9.3 =
|
460 |
+
* Field: Flexible Content - Added `filter('acfe/flexible/thumbnail/name={flexible:name}', $thumbnail, $field, $layout)` to change all layouts thumbnails (must return `attachment ID` or `URL`) (Thanks @Dam)
|
461 |
+
* Field: Flexible Content - Fixed `$is_preview` not being available during the Dynamic Layout Preview (thanks @Dam)
|
462 |
+
* Module: Author Box - Added custom authors roles being able to be selected in the Author Box (Thanks @Andremacola)
|
463 |
+
* General: Fixed Readme typos
|
464 |
+
|
465 |
= 0.7.9 =
|
466 |
* Field: Flexible Content - Added Inline Layout Title Edition
|
467 |
* Field: Flexible Content - Added Auto scroll + Modal edit on One Click layout
|
468 |
* Field: Flexible Content - Removed native "Controls Icons" visibility being visible on all sub flexible content fields (better readability)
|
469 |
* Field: Flexible Content - Added WP Unslash on preview values to prevent backlashes on values (thanks @Dam)
|
470 |
* Field: Flexible Content - Added compatibility for layouts that have been synced and not manually created (thanks @T. Dubois)
|
471 |
+
* Field: Flexible Content - Copy/Paste functionality is now a Flexible Content setting (Default: Disabled) (Feature request: @louiswalch)
|
472 |
* Field: Flexible Content - 'Close Button' (collapse) on layouts is now a Flexible Content setting(Default: Disabled)
|
473 |
+
* Field: Flexible Content - Layouts Thumbnails aspect ratio are now locked (base ratio: 450px * 200px) (Feature request: @louiswalch)
|
474 |
* Field: Flexible Content - Dynamic Layout Preview refresh has been optimized. The preview content is now kept instead of being reset
|
475 |
* Field: Flexible Content - Dynamic Layout Preview style & script enqueue now use wp_enqueue_style() & wp_enqueue_script()
|
476 |
* Field: Flexible Content - Modal Edition - 'Enter' & 'ESC' keys now close Modals (instead of submitting the form)
|
481 |
* Field: Flexible Content - Added `filter('acfe/flexible/render/style', $style, $field, $layout, $is_preview)` to change Layout Render: Style Path (with 6 variations)
|
482 |
* Field: Flexible Content - Added `filter('acfe/flexible/render/script', $script, $field, $layout, $is_preview)` to change Layout Render: Script Path (with 6 variations)
|
483 |
* Field: Flexible Content - Added `filter('acfe/flexible/placeholder/icon', $class, $field)` to change the Placeholder Button Dashicon class (default: 'dashicons dashicons-edit') (with 3 variations)
|
484 |
+
* Module: Dynamic Options Page - Fixed 'Undefined $post_id' PHP warning in Dynamic Options Page screen
|
485 |
* Module: Dynamic Options Page - Fixed registration order for child options pages (thanks @Val)
|
486 |
* Module: Dynamic Post Type - Fixed undefined ID php Warning on edit screen when Dynamic Post Type is registered locally (thanks @Val)
|
487 |
* Module: Dynamic Taxonomies - Taxonomy name character limit has been fixed to 32 instead of 20 (thanks @Damian)
|