Advanced Custom Fields: Extended - Version 0.8.4

Version Description

  • Module: Added Single Meta Save feature - Compress all fields values from the current post, term or user into one single meta data. This feature is disabled by default, to enable it, use acf_update_setting('acfe/modules/single_meta', true);. More informations available in the readme.
  • Module: Dynamic Post Types - Added while(have_archive()): the_archive(); logic when the "Admin Archive Page" setting is turned on. This template tags can be used in the archive-post-type.php template which makes get_field('my_field') calls easier
  • Module: Dynamic Post Types/Taxonomies - Fixed Posts/Terms column data when object was trashed.
  • Module: PHP AutoSync - PHP sync files are now removed when the field group is disabled/trashed.
  • Module: Dynamic Forms - In the "E-mail Action" the "From" field is now required.
  • Module: Dynamic Forms - The Javascript hook acfe/form/submit/success is now correctly fired on form submission
  • Module: Dev Mode - Added the WP & ACF Meta Overview on User pages
  • Module: Dynamic Post Types/Taxonomies/Options Pages/Block Types - Removed Draft button action
  • Field: Flexible Content - Significant Performance Boost (~50/60% faster during the loading). Many settings are now loaded in PHP. This massive rework brings some great performance on complex Flexible Content fields.
  • Field: Flexible Content - Added "Layouts: Asynchronous" setting which add layouts using Ajax method (instead of having hidden layouts models in the DOM). This setting increase performance on complex Flexible Content fields.
  • Field: Flexible Content - Added "Layouts: Settings" setting which let you choose a field group to clone and to be used as a configuration modal for each layout. Settings can then be used using while(have_settings()): the_setting(); get_sub_field('my_setting'); in the Layout Template.
  • Field: Flexible Content - Initial "Dynamic Preview" are now processed during page administration load, and not Ajax anymore. This tweak also speed-up the loading speed.
  • Field: Flexible Content - Fixed a potential duplicated categories bug in the Selection Modal if the category name had spaces.
  • Field: Flexible Content - "Remove Actions" now correctly remove Clone & Copy/Paste buttons.
  • Field: Flexible Content - Added "Disable Legacy Layout Title Ajax" setting. It disables the native ACF Layout Title Ajax call on acf/fields/flexible_content/layout_title.
  • Field: Flexible Content - Fixed the $is_preview variable not being available in specific situations.
  • Field: Flexible Content - Fixed Dynamic Preview repeater fields inside a layout which could send an additional acfcloneindex during the preview mode
  • Field: Flexible Content - Fixed Dynamic Preview with WP Query in the layout, which could be duplicated due to how WP Admin manage custom queries
  • Field: Flexible Content - Fixed "Edit" icon vertical align with the latest WP 5.3 update
  • Field: Flexible Content - Added shorter CSS class for preview wrapper -preview
  • Field: Flexible Content - Fixed the native ACF setting "Select layout" with a wrong height on WP 5.3
  • Field: Flexible Content - Fixed Enter key opening duplicated modal with Modal Edition setting
  • Field: Flexible Content - Added filter('acfe/flexible/layouts/div/name=my_flexible', $div, $layout, $field) to change layout div attributes (with 5 variations)
  • Field: Flexible Content - Added filter('acfe/flexible/layouts/handle/name=my_flexible', $handle, $layout, $field) to change layout handle attributes (with 5 variations)
  • Field: Flexible Content - Added filter('acfe/flexible/layouts/icons/name=my_flexible', $icons, $layout, $field) to change layout handle icons (with 5 variations)
  • Field: Flexible Content - Added filter('acfe/flexible/secondary_actions/name=my_flexible', $secondary_actions, $field) to change Flexible Content secondary actions (copy, paste...) (with 3 variations)
  • Field: Advanced Link - Fixed required validation which could fail if a post object was selected.
  • Field: Advanced Link - Fixed a z-index problem in menu/items
  • Field: Code Editor - Added compatibility with WP Code Editor Settings (editor themes).
  • Field: Group/Clone - In Seamless Style mode instructions could be truncated in some specific cases
  • Field: Group/Clone - Seamless Style mode wasn't working correctly in the Term administration
  • Field: Group/Clone - Fixed "Seamless Style" typo
  • Field: Group/Clone - Fixed "Edit in modal" which wasn't correctly working in menus
  • Field Group: Fixed Category sync which failed to create & set new field group category if not already available in WP
  • Field Groups: Fixed empty field groups list colspan
  • Fields: Post Statuses/Post Types/Taxonomies/Taxonomies Terms/User Roles can now be used as conditional display field
  • General: ACF Extended now correctly detects ACF Pro when included in the WP Theme.
  • General: ACF Extended can now be included in WP Themes (following the same logic as ACF)
Download this release

Release Info

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

Code changes from version 0.8.3.1 to 0.8.4

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.8.3.1
6
  * Author: ACF Extended
7
  * Author URI: https://www.acf-extended.com
8
  * Text Domain: acfe
@@ -16,7 +16,7 @@ if(!class_exists('ACFE')):
16
  class ACFE{
17
 
18
  // Version
19
- var $version = '0.8.3.1';
20
 
21
  // Settings
22
  var $settings = array();
@@ -40,7 +40,6 @@ class ACFE{
40
  $this->define('ACFE', true);
41
  $this->define('ACFE_FILE', __FILE__);
42
  $this->define('ACFE_PATH', plugin_dir_path(__FILE__));
43
- $this->define('ACFE_URL', plugin_dir_url(__FILE__));
44
  $this->define('ACFE_VERSION', $this->version);
45
  $this->define('ACFE_BASENAME', plugin_basename(__FILE__));
46
  $this->define('ACFE_THEME_PATH', get_stylesheet_directory());
@@ -48,6 +47,7 @@ class ACFE{
48
 
49
  // Define settings
50
  $this->settings = array(
 
51
  'acfe/php' => true,
52
  'acfe/php_save' => ACFE_THEME_PATH . '/acfe-php',
53
  'acfe/php_load' => array(ACFE_THEME_PATH . '/acfe-php'),
@@ -61,6 +61,7 @@ class ACFE{
61
  'acfe/modules/dynamic_post_types' => true,
62
  'acfe/modules/dynamic_taxonomies' => true,
63
  'acfe/modules/options' => true,
 
64
  'acfe/modules/taxonomies' => true,
65
  );
66
 
@@ -68,7 +69,7 @@ class ACFE{
68
  include_once(ACFE_PATH . 'init.php');
69
 
70
  // Load
71
- add_action('plugins_loaded', array($this, 'load'));
72
 
73
  }
74
 
@@ -172,6 +173,7 @@ class ACFE{
172
  acfe_include('includes/modules/dynamic-options-page.php');
173
  acfe_include('includes/modules/dynamic-post-type.php');
174
  acfe_include('includes/modules/dynamic-taxonomy.php');
 
175
  acfe_include('includes/modules/taxonomy.php');
176
 
177
  }
2
  /**
3
  * Plugin Name: Advanced Custom Fields: Extended
4
  * Description: Enhancement Suite which improves Advanced Custom Fields administration
5
+ * Version: 0.8.4
6
  * Author: ACF Extended
7
  * Author URI: https://www.acf-extended.com
8
  * Text Domain: acfe
16
  class ACFE{
17
 
18
  // Version
19
+ var $version = '0.8.4';
20
 
21
  // Settings
22
  var $settings = array();
40
  $this->define('ACFE', true);
41
  $this->define('ACFE_FILE', __FILE__);
42
  $this->define('ACFE_PATH', plugin_dir_path(__FILE__));
 
43
  $this->define('ACFE_VERSION', $this->version);
44
  $this->define('ACFE_BASENAME', plugin_basename(__FILE__));
45
  $this->define('ACFE_THEME_PATH', get_stylesheet_directory());
47
 
48
  // Define settings
49
  $this->settings = array(
50
+ 'acfe/url' => plugin_dir_url(__FILE__),
51
  'acfe/php' => true,
52
  'acfe/php_save' => ACFE_THEME_PATH . '/acfe-php',
53
  'acfe/php_load' => array(ACFE_THEME_PATH . '/acfe-php'),
61
  'acfe/modules/dynamic_post_types' => true,
62
  'acfe/modules/dynamic_taxonomies' => true,
63
  'acfe/modules/options' => true,
64
+ 'acfe/modules/single_meta' => false,
65
  'acfe/modules/taxonomies' => true,
66
  );
67
 
69
  include_once(ACFE_PATH . 'init.php');
70
 
71
  // Load
72
+ add_action('after_setup_theme', array($this, 'load'));
73
 
74
  }
75
 
173
  acfe_include('includes/modules/dynamic-options-page.php');
174
  acfe_include('includes/modules/dynamic-post-type.php');
175
  acfe_include('includes/modules/dynamic-taxonomy.php');
176
+ acfe_include('includes/modules/single-meta.php');
177
  acfe_include('includes/modules/taxonomy.php');
178
 
179
  }
assets/acf-extended-admin.css CHANGED
@@ -48,18 +48,16 @@ code, kbd, pre, samp{
48
  .wrap .acfe-dt-admin-config span{
49
  font-size: 16px;
50
  vertical-align: text-top;
51
- color:#444;
52
- }
53
-
54
- .wrap .acfe-dpt-admin-config:hover span,
55
- .wrap .acfe-dt-admin-config:hover span{
56
- color:#fff;
57
  }
58
 
59
  /*
60
  * ACFE: Dynamic Post Type
61
  */
62
  body.post-type-acfe-dpt.post-new-php #misc-publishing-actions,
 
63
  body.post-type-acfe-dpt .misc-pub-post-status,
64
  body.post-type-acfe-dpt .misc-pub-visibility{
65
  display:none;
@@ -73,6 +71,7 @@ body.post-type-acfe-dpt.post-new-php #major-publishing-actions{
73
  * ACFE: Dynamic Taxonomy
74
  */
75
  body.post-type-acfe-dt.post-new-php #misc-publishing-actions,
 
76
  body.post-type-acfe-dt .misc-pub-post-status,
77
  body.post-type-acfe-dt .misc-pub-visibility{
78
  display:none;
@@ -86,6 +85,7 @@ body.post-type-acfe-dt.post-new-php #major-publishing-actions{
86
  * ACFE: Dynamic Options Page
87
  */
88
  body.post-type-acfe-dop.post-new-php #misc-publishing-actions,
 
89
  body.post-type-acfe-dop .misc-pub-post-status,
90
  body.post-type-acfe-dop .misc-pub-visibility{
91
  display:none;
@@ -99,6 +99,7 @@ body.post-type-acfe-dop.post-new-php #major-publishing-actions{
99
  * ACFE: Dynamic Block Type
100
  */
101
  body.post-type-acfe-dbt.post-new-php #misc-publishing-actions,
 
102
  body.post-type-acfe-dbt .misc-pub-post-status,
103
  body.post-type-acfe-dbt .misc-pub-visibility{
104
  display:none;
@@ -112,6 +113,7 @@ body.post-type-acfe-dbt.post-new-php #major-publishing-actions{
112
  * ACFE: Dynamic Forms
113
  */
114
  body.post-type-acfe-form.post-new-php #misc-publishing-actions,
 
115
  body.post-type-acfe-form .misc-pub-post-status,
116
  body.post-type-acfe-form .misc-pub-visibility{
117
  display:none;
@@ -292,4 +294,11 @@ body:not(.acf-admin-5-3) .select2-container .select2-search--inline .select2-sea
292
 
293
  .select2-container--default.select2-container--focus .select2-selection--multiple{
294
  border-color:#7e8993 !important;
 
 
 
 
 
 
 
295
  }
48
  .wrap .acfe-dt-admin-config span{
49
  font-size: 16px;
50
  vertical-align: text-top;
51
+ height: 15px;
52
+ width: 19px;
53
+ line-height: 19px;
 
 
 
54
  }
55
 
56
  /*
57
  * ACFE: Dynamic Post Type
58
  */
59
  body.post-type-acfe-dpt.post-new-php #misc-publishing-actions,
60
+ body.post-type-acfe-dpt.post-new-php #minor-publishing-actions,
61
  body.post-type-acfe-dpt .misc-pub-post-status,
62
  body.post-type-acfe-dpt .misc-pub-visibility{
63
  display:none;
71
  * ACFE: Dynamic Taxonomy
72
  */
73
  body.post-type-acfe-dt.post-new-php #misc-publishing-actions,
74
+ body.post-type-acfe-dt.post-new-php #minor-publishing-actions,
75
  body.post-type-acfe-dt .misc-pub-post-status,
76
  body.post-type-acfe-dt .misc-pub-visibility{
77
  display:none;
85
  * ACFE: Dynamic Options Page
86
  */
87
  body.post-type-acfe-dop.post-new-php #misc-publishing-actions,
88
+ body.post-type-acfe-dop.post-new-php #minor-publishing-actions,
89
  body.post-type-acfe-dop .misc-pub-post-status,
90
  body.post-type-acfe-dop .misc-pub-visibility{
91
  display:none;
99
  * ACFE: Dynamic Block Type
100
  */
101
  body.post-type-acfe-dbt.post-new-php #misc-publishing-actions,
102
+ body.post-type-acfe-dbt.post-new-php #minor-publishing-actions,
103
  body.post-type-acfe-dbt .misc-pub-post-status,
104
  body.post-type-acfe-dbt .misc-pub-visibility{
105
  display:none;
113
  * ACFE: Dynamic Forms
114
  */
115
  body.post-type-acfe-form.post-new-php #misc-publishing-actions,
116
+ body.post-type-acfe-form.post-new-php #minor-publishing-actions,
117
  body.post-type-acfe-form .misc-pub-post-status,
118
  body.post-type-acfe-form .misc-pub-visibility{
119
  display:none;
294
 
295
  .select2-container--default.select2-container--focus .select2-selection--multiple{
296
  border-color:#7e8993 !important;
297
+ }
298
+
299
+ /*
300
+ * Menu Item: Fix Modal z-index
301
+ */
302
+ .menu-item-settings{
303
+ position:initial;
304
  }
assets/acf-extended-fc-control.css CHANGED
@@ -1,18 +1,25 @@
1
  /*
2
  * ACFE: Flexible Icons
3
  */
4
- .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons{
5
- visibility: hidden;
6
- }
7
-
8
  .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons:before{
9
  font-family: dashicons;
10
  }
11
 
 
 
 
 
12
  .acf-flexible-content .layout:hover > .acf-fc-layout-controls .acf-icon.acfe-flexible-icon.dashicons{
13
  visibility: visible;
14
  }
15
 
 
 
 
 
 
 
 
16
  .acf-flexible-content .layout:hover .acf-fc-layout-controls .acf-icon.-plus,
17
  .acf-flexible-content .layout:hover .acf-fc-layout-controls .acf-icon.-minus,
18
  .acf-flexible-content .layout.-hover .acf-fc-layout-controls .acf-icon.-plus,
1
  /*
2
  * ACFE: Flexible Icons
3
  */
 
 
 
 
4
  .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons:before{
5
  font-family: dashicons;
6
  }
7
 
8
+ .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons{
9
+ visibility: hidden;
10
+ }
11
+
12
  .acf-flexible-content .layout:hover > .acf-fc-layout-controls .acf-icon.acfe-flexible-icon.dashicons{
13
  visibility: visible;
14
  }
15
 
16
+ .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons.dashicons-admin-generic{
17
+ visibility: visible;
18
+ }
19
+ .acf-flexible-content .layout .acf-icon.acfe-flexible-icon.dashicons.dashicons-admin-generic:before{
20
+ margin-left: 1px;
21
+ }
22
+
23
  .acf-flexible-content .layout:hover .acf-fc-layout-controls .acf-icon.-plus,
24
  .acf-flexible-content .layout:hover .acf-fc-layout-controls .acf-icon.-minus,
25
  .acf-flexible-content .layout.-hover .acf-fc-layout-controls .acf-icon.-plus,
assets/acf-extended-fc-control.js CHANGED
@@ -118,7 +118,7 @@
118
  model.acfeEditLayoutTitleInputEnter = function(e, $el){
119
 
120
  // Enter Key
121
- if(e.keyCode != 13)
122
  return;
123
 
124
  e.preventDefault();
@@ -126,6 +126,45 @@
126
 
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  // Layout: Clone
130
  model.events['click [data-acfe-flexible-control-clone]'] = 'acfeCloneLayout';
131
  model.acfeCloneLayout = function(e, $el){
@@ -655,16 +694,6 @@
655
 
656
  }
657
 
658
- // Flexible: Lock Layouts
659
- model.acfeOnHover = function(){
660
-
661
- var flexible = this;
662
-
663
- // remove event
664
- flexible.off('mouseover');
665
-
666
- }
667
-
668
  /*
669
  * Spawn
670
  */
@@ -675,130 +704,8 @@
675
 
676
  flexible.removeEvents({'mouseover': 'onHover'});
677
 
678
- flexible.addEvents({'mouseover': 'acfeOnHover'});
679
-
680
- }
681
-
682
- // ACFE: Remove Actions
683
- if(flexible.has('acfeFlexibleRemoveActions')){
684
-
685
- flexible.$actions().remove();
686
-
687
- flexible.$layouts().find('> .acf-fc-layout-controls > [data-name="add-layout"]').remove();
688
- flexible.$layouts().find('> .acf-fc-layout-controls > [data-name="remove-layout"]').remove();
689
- flexible.$layouts().find('> .acf-fc-layout-controls > [data-acfe-flexible-control-clone="layout"]').remove();
690
-
691
- flexible.$control().find('> .acfe-flexible-stylised-button').remove();
692
-
693
-
694
- }
695
-
696
- // ACFE: Remove Ajax Title
697
- if(flexible.has('acfeFlexibleRemoveAjaxTitle')){
698
-
699
- flexible.renderLayout = function($layout){};
700
-
701
-
702
- }
703
-
704
- if(flexible.has('acfeFlexibleCopyPaste')){
705
-
706
- /*
707
- * Stylised Button
708
- */
709
- if(flexible.has('acfeFlexibleStylisedButton')){
710
-
711
- var $dropdown = $('' +
712
- '<a href="#" class="button" style="padding-left:5px;padding-right:5px; margin-left:3px;" data-name="acfe-flexible-control-button">' +
713
- ' <span class="dashicons dashicons-arrow-down-alt2" style="vertical-align:text-top;width:auto;height:auto;font-size:13px;line-height:20px;"></span>' +
714
- '</a>' +
715
-
716
- '<script type="text-html" class="tmpl-acfe-flexible-control-popup">' +
717
- ' <ul>' +
718
- ' <li><a href="#" data-acfe-flexible-control-action="copy">Copy layouts</a></li>' +
719
- ' <li><a href="#" data-acfe-flexible-control-action="paste">Paste layouts</a></li>' +
720
- ' </ul>' +
721
- '</script>');
722
-
723
- // Add button
724
- flexible.$el.find('> .acf-input > .acf-flexible-content > .acfe-flexible-stylised-button > .acf-actions > .acf-button').after($dropdown);
725
-
726
-
727
- }
728
-
729
- /*
730
- * Unstylised
731
- */
732
- else{
733
-
734
- var $dropdown = $('' +
735
- '<a href="#" class="button button-primary" style="padding-left:5px;padding-right:5px; margin-left:3px;" data-name="acfe-flexible-control-button">' +
736
- ' <span class="dashicons dashicons-arrow-down-alt2" style="vertical-align:text-top;width:auto;height:auto;font-size:13px;line-height:20px;"></span>' +
737
- '</a>' +
738
-
739
- '<script type="text-html" class="tmpl-acfe-flexible-control-popup">' +
740
- ' <ul>' +
741
- ' <li><a href="#" data-acfe-flexible-control-action="copy">Copy layouts</a></li>' +
742
- ' <li><a href="#" data-acfe-flexible-control-action="paste">Paste layouts</a></li>' +
743
- ' </ul>' +
744
- '</script>');
745
-
746
- // Add button
747
- flexible.$el.find('> .acf-input > .acf-flexible-content > .acf-actions > .acf-button').after($dropdown);
748
-
749
- }
750
-
751
  }
752
 
753
  });
754
 
755
- acf.addAction('acfe/flexible/layouts', function($layout, flexible){
756
-
757
- // vars
758
- var $controls = $layout.find('> .acf-fc-layout-controls');
759
- var $handle = $layout.find('> .acf-fc-layout-handle');
760
-
761
- // Button: Copy
762
- if(flexible.has('acfeFlexibleCopyPaste') && !$controls.has('[data-acfe-flexible-control-copy]').length){
763
-
764
- $controls.prepend('<a class="acf-icon small light acf-js-tooltip acfe-flexible-icon dashicons dashicons-category" href="#" title="Copy layout" data-acfe-flexible-control-copy="' + $layout.attr('data-layout') + '"></a>');
765
-
766
- }
767
-
768
- // Button: Clone
769
- if(!$controls.has('[data-acfe-flexible-control-clone]').length){
770
-
771
- $controls.prepend('<a class="acf-icon small light acf-js-tooltip acfe-flexible-icon dashicons dashicons-admin-page" href="#" title="Clone layout" data-acfe-flexible-control-clone="' + $layout.attr('data-layout') + '"></a>');
772
-
773
- }
774
-
775
- if(flexible.has('acfeFlexibleTitleEdition')){
776
-
777
- if(flexible.has('acfeFlexibleModalEdition')){
778
-
779
- var $hidden = $layout.find('> .acfe-modal > .acfe-modal-wrapper > .acfe-modal-content > .acf-fields > .acf-field-acfe-flexible-layout-title > .acf-input > .acf-input-wrap > input');
780
-
781
- }else{
782
-
783
- var $hidden = $layout.find('> .acf-fields > .acf-field-acfe-flexible-layout-title > .acf-input > .acf-input-wrap > input');
784
-
785
- }
786
-
787
- // Hidden Input
788
- if($hidden.length){
789
-
790
- // Add Edit Title
791
- $hidden.addClass('acfe-flexible-control-title').attr('data-acfe-flexible-control-title-input', 1).insertAfter($handle);
792
-
793
- // Remove legacy field
794
- $layout.find('> .acf-fields > .acf-field-acfe-flexible-layout-title').remove();
795
-
796
- }
797
-
798
- }
799
-
800
-
801
-
802
- });
803
-
804
  })(jQuery);
118
  model.acfeEditLayoutTitleInputEnter = function(e, $el){
119
 
120
  // Enter Key
121
+ if(e.keyCode !== 13)
122
  return;
123
 
124
  e.preventDefault();
126
 
127
  }
128
 
129
+ // Layout: Settings
130
+ model.events['click [data-acfe-flexible-settings]'] = 'acfeLayoutSettings';
131
+ model.acfeLayoutSettings = function(e, $el){
132
+
133
+ // Get Flexible
134
+ var flexible = this;
135
+
136
+ // Vars
137
+ var $layout = $el.closest('.layout');
138
+
139
+ // Modal data
140
+ var $modal = $layout.find('> .acfe-modal.-settings');
141
+ var $handle = $layout.find('> .acf-fc-layout-handle');
142
+
143
+ var $layout_order = $handle.find('> .acf-fc-layout-order').outerHTML();
144
+ var $layout_title = $handle.find('.acfe-layout-title-text').text();
145
+
146
+ // Open modal
147
+ acfe.modal.open($modal, {
148
+ title: $layout_order + ' ' + $layout_title,
149
+ footer: false,
150
+ onOpen: function(){
151
+
152
+ flexible.acfeEditorsInit($layout);
153
+
154
+ },
155
+ onClose: function(){
156
+
157
+ if(flexible.has('acfeFlexiblePreview')){
158
+
159
+ flexible.closeLayout($layout);
160
+
161
+ }
162
+
163
+ }
164
+ });
165
+
166
+ }
167
+
168
  // Layout: Clone
169
  model.events['click [data-acfe-flexible-control-clone]'] = 'acfeCloneLayout';
170
  model.acfeCloneLayout = function(e, $el){
694
 
695
  }
696
 
 
 
 
 
 
 
 
 
 
 
697
  /*
698
  * Spawn
699
  */
704
 
705
  flexible.removeEvents({'mouseover': 'onHover'});
706
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  }
708
 
709
  });
710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711
  })(jQuery);
assets/acf-extended-fc-modal-edit.js CHANGED
@@ -21,7 +21,7 @@
21
  var $layout = $el.closest('.layout');
22
 
23
  // Modal data
24
- var $modal = $layout.find('> .acfe-modal');
25
  var $handle = $layout.find('> .acf-fc-layout-handle');
26
 
27
  var $layout_order = $handle.find('> .acf-fc-layout-order').outerHTML();
@@ -38,9 +38,16 @@
38
  acfe.modal.open($modal, {
39
  title: $layout_order + ' ' + $layout_title,
40
  footer: close,
 
 
 
 
 
 
 
41
  onClose: function(){
42
 
43
- flexible.acfeCloseLayoutInit($layout);
44
 
45
  }
46
  });
@@ -52,35 +59,16 @@
52
  */
53
  acf.addAction('new_field/type=flexible_content', function(flexible){
54
 
55
- if(!flexible.has('acfeFlexibleModalEdition'))
56
- return;
57
-
58
- if(flexible.has('acfeFlexiblePlaceholder') || flexible.has('acfeFlexiblePreview')){
59
 
60
  // Remove Collapse Action
61
  flexible.removeEvents({'click [data-name="collapse-layout"]': 'onClickCollapse'});
62
 
63
  // Remove placeholder Collapse Action
64
- flexible.removeEvents({'click .acfe-flexible-collapsed-placeholder': 'onClickCollapse'});
65
 
66
  }
67
 
68
  });
69
 
70
- /*
71
- * Remove Legacy Collapse
72
- */
73
- acf.addAction('acfe/flexible/layouts', function($layout, flexible){
74
-
75
- if(!flexible.has('acfeFlexibleModalEdition'))
76
- return;
77
-
78
- // var
79
- var $controls = $layout.find('> .acf-fc-layout-controls');
80
-
81
- // Remove collapse button
82
- $controls.find('> a.-collapse').remove();
83
-
84
- });
85
-
86
  })(jQuery);
21
  var $layout = $el.closest('.layout');
22
 
23
  // Modal data
24
+ var $modal = $layout.find('> .acfe-modal.-fields');
25
  var $handle = $layout.find('> .acf-fc-layout-handle');
26
 
27
  var $layout_order = $handle.find('> .acf-fc-layout-order').outerHTML();
38
  acfe.modal.open($modal, {
39
  title: $layout_order + ' ' + $layout_title,
40
  footer: close,
41
+ onOpen: function(){
42
+
43
+ flexible.openLayout($layout);
44
+
45
+ flexible.acfeEditorsInit($layout);
46
+
47
+ },
48
  onClose: function(){
49
 
50
+ flexible.closeLayout($layout);
51
 
52
  }
53
  });
59
  */
60
  acf.addAction('new_field/type=flexible_content', function(flexible){
61
 
62
+ if(flexible.has('acfeFlexibleModalEdition') && (flexible.has('acfeFlexiblePlaceholder') || flexible.has('acfeFlexiblePreview'))){
 
 
 
63
 
64
  // Remove Collapse Action
65
  flexible.removeEvents({'click [data-name="collapse-layout"]': 'onClickCollapse'});
66
 
67
  // Remove placeholder Collapse Action
68
+ flexible.removeEvents({'click .acfe-fc-placeholder': 'onClickCollapse'});
69
 
70
  }
71
 
72
  });
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  })(jQuery);
assets/acf-extended-fc-modal-select.js CHANGED
@@ -43,7 +43,7 @@
43
 
44
  if(!$link.data('acfe-flexible-category'))
45
  return true;
46
-
47
  var category = $link.data('acfe-flexible-category');
48
 
49
  // With pipes
43
 
44
  if(!$link.data('acfe-flexible-category'))
45
  return true;
46
+
47
  var category = $link.data('acfe-flexible-category');
48
 
49
  // With pipes
assets/acf-extended-fc.css CHANGED
@@ -30,10 +30,12 @@
30
  /*
31
  * Flexible: Layout Collapsed
32
  */
33
- .acf-field-flexible-content[data-acfe-flexible-modal-edition="1"] > .acf-input > .acf-flexible-content > .values > .layout > .acf-fc-layout-handle{
 
34
  border-bottom-width:0;
35
  }
36
 
 
37
  .acf-field-flexible-content[data-acfe-flexible-placeholder="1"] > .acf-input > .acf-flexible-content > .values > .layout.-collapsed > .acf-fc-layout-handle,
38
  .acf-field-flexible-content[data-acfe-flexible-preview="1"] > .acf-input > .acf-flexible-content > .values > .layout.-collapsed > .acf-fc-layout-handle{
39
  border-bottom-width:1px;
@@ -81,7 +83,7 @@
81
  /*
82
  * Flexible Layout: Placeholder
83
  */
84
- .layout > .acfe-flexible-collapsed-placeholder{
85
  text-align:center;
86
  background:#f9f9f9;
87
  display:block;
@@ -90,19 +92,19 @@
90
  cursor:pointer;
91
  }
92
 
93
- .layout > .acfe-flexible-collapsed-placeholder:focus{
94
  border-color: #ccc;
95
  box-shadow: none;
96
  }
97
 
98
- .layout > .acfe-flexible-collapsed-placeholder > .acfe-flexible-placeholder{
99
  height:110px;
100
  overflow:hidden;
101
  text-align:initial;
102
  }
103
 
104
- .layout > .acfe-flexible-collapsed-placeholder > button{
105
- z-index:2;
106
  position:absolute;
107
  top:50%;
108
  left:50%;
@@ -118,55 +120,59 @@
118
  display:block;
119
  }
120
 
121
- body:not(.acf-admin-5-3) .layout > .acfe-flexible-collapsed-placeholder > button{
122
  border-color: #999;
123
  }
124
 
125
- .layout > .acfe-flexible-collapsed-placeholder > button:active{
 
 
 
 
126
  transform:translate(-50%, -50%);
127
  }
128
 
129
- .layout > .acfe-flexible-collapsed-placeholder > button:focus{
130
  border-color: #cccccc;
131
  box-shadow: none;
132
  }
133
 
134
- .layout > .acfe-flexible-collapsed-placeholder > button span{
135
- width: 28px;
136
- height: 28px;
137
- vertical-align:middle;
138
  line-height: 28px;
139
  font-size:18px;
140
  }
141
 
142
- body:not(.acf-admin-5-3) .layout > .acfe-flexible-collapsed-placeholder > button span{
143
  width: 30px;
144
  height: 30px;
145
  }
146
 
147
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview{
148
  background:none;
149
  }
150
 
151
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview > .acfe-flexible-placeholder{
152
  min-height:55px;
153
  height:auto;
154
  }
155
 
156
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview > button{
157
  display:none;
158
  }
159
 
160
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview:hover > button{
161
  display:block;
162
  }
163
 
164
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview.acfe-is-loading{
165
  background:#f9f9f9;
166
  min-height:110px;
167
  }
168
 
169
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview.acfe-is-loading > .acfe-flexible-placeholder > .spinner{
170
  visibility:visible;
171
  float:none;
172
  position:absolute;
@@ -177,8 +183,7 @@ body:not(.acf-admin-5-3) .layout > .acfe-flexible-collapsed-placeholder > button
177
  z-index:10000;
178
  }
179
 
180
- .layout > .acfe-flexible-collapsed-placeholder .acfe-flexible-collapsed-overlay{
181
- z-index:1;
182
  position:absolute;
183
  width:100%;
184
  height:100%;
@@ -189,19 +194,20 @@ body:not(.acf-admin-5-3) .layout > .acfe-flexible-collapsed-placeholder > button
189
  transition: background-color 200ms linear;
190
  }
191
 
192
- .layout > .acfe-flexible-collapsed-placeholder:hover .acfe-flexible-collapsed-overlay,
193
- .layout > .acfe-flexible-collapsed-placeholder .acfe-flexible-collapsed-overlay.-hover{
194
  background-color:rgba(255,255,255,0.7);
195
  }
196
 
197
- .layout > .acfe-flexible-collapsed-placeholder.acfe-flexible-collapsed-preview.acfe-is-loading > button span{
198
  visibility:hidden;
199
  }
200
 
201
  /*
202
  * Flexible Layout Collapsed
203
  */
204
- .layout > .acfe-flexible-opened-actions{
 
205
  background:#f9f9f9;
206
  border-top:1px solid #e1e1e1;
207
  padding:12px;
30
  /*
31
  * Flexible: Layout Collapsed
32
  */
33
+
34
+ .acf-field-flexible-content[data-acfe-flexible-modal-edition="1"]:not([data-acfe-flexible-placeholder="1"]):not([data-acfe-flexible-preview="1"]) > .acf-input > .acf-flexible-content > .values > .layout > .acf-fc-layout-handle{
35
  border-bottom-width:0;
36
  }
37
 
38
+
39
  .acf-field-flexible-content[data-acfe-flexible-placeholder="1"] > .acf-input > .acf-flexible-content > .values > .layout.-collapsed > .acf-fc-layout-handle,
40
  .acf-field-flexible-content[data-acfe-flexible-preview="1"] > .acf-input > .acf-flexible-content > .values > .layout.-collapsed > .acf-fc-layout-handle{
41
  border-bottom-width:1px;
83
  /*
84
  * Flexible Layout: Placeholder
85
  */
86
+ .layout > .acfe-fc-placeholder{
87
  text-align:center;
88
  background:#f9f9f9;
89
  display:block;
92
  cursor:pointer;
93
  }
94
 
95
+ .layout > .acfe-fc-placeholder:focus{
96
  border-color: #ccc;
97
  box-shadow: none;
98
  }
99
 
100
+ .layout > .acfe-fc-placeholder > .acfe-flexible-placeholder{
101
  height:110px;
102
  overflow:hidden;
103
  text-align:initial;
104
  }
105
 
106
+ .layout > .acfe-fc-placeholder > a{
107
+ z-index:1;
108
  position:absolute;
109
  top:50%;
110
  left:50%;
120
  display:block;
121
  }
122
 
123
+ body:not(.acf-admin-5-3) .layout > .acfe-fc-placeholder > a{
124
  border-color: #999;
125
  }
126
 
127
+ .acfe-modal.-open.acfe-modal-sub > .acfe-modal-wrapper > .acfe-modal-content > .acf-fields > .acf-field-flexible-content > .acf-input > .acf-flexible-content > .values > .layout > .acfe-fc-placeholder > a{
128
+ z-index:0;
129
+ }
130
+
131
+ .layout > .acfe-fc-placeholder > a:active{
132
  transform:translate(-50%, -50%);
133
  }
134
 
135
+ .layout > .acfe-fc-placeholder > a:focus{
136
  border-color: #cccccc;
137
  box-shadow: none;
138
  }
139
 
140
+ .layout > .acfe-fc-placeholder > a span{
141
+ width: 29px;
142
+ height: 30px;
143
+ vertical-align:top;
144
  line-height: 28px;
145
  font-size:18px;
146
  }
147
 
148
+ body:not(.acf-admin-5-3) .layout > .acfe-fc-placeholder > a span{
149
  width: 30px;
150
  height: 30px;
151
  }
152
 
153
+ .layout > .acfe-fc-placeholder.acfe-fc-preview{
154
  background:none;
155
  }
156
 
157
+ .layout > .acfe-fc-placeholder.acfe-fc-preview > .acfe-flexible-placeholder{
158
  min-height:55px;
159
  height:auto;
160
  }
161
 
162
+ .layout > .acfe-fc-placeholder.acfe-fc-preview > a{
163
  display:none;
164
  }
165
 
166
+ .layout > .acfe-fc-placeholder.acfe-fc-preview:hover > a{
167
  display:block;
168
  }
169
 
170
+ .layout > .acfe-fc-placeholder.acfe-fc-preview.-loading{
171
  background:#f9f9f9;
172
  min-height:110px;
173
  }
174
 
175
+ .layout > .acfe-fc-placeholder.acfe-fc-preview.-loading > .acfe-flexible-placeholder > .spinner{
176
  visibility:visible;
177
  float:none;
178
  position:absolute;
183
  z-index:10000;
184
  }
185
 
186
+ .layout > .acfe-fc-placeholder .acfe-fc-overlay{
 
187
  position:absolute;
188
  width:100%;
189
  height:100%;
194
  transition: background-color 200ms linear;
195
  }
196
 
197
+ .layout > .acfe-fc-placeholder:hover .acfe-fc-overlay,
198
+ .layout > .acfe-fc-placeholder .acfe-fc-overlay.-hover{
199
  background-color:rgba(255,255,255,0.7);
200
  }
201
 
202
+ .layout > .acfe-fc-placeholder.acfe-fc-preview.-loading > a span{
203
  visibility:hidden;
204
  }
205
 
206
  /*
207
  * Flexible Layout Collapsed
208
  */
209
+ .layout > .acf-fields > .acfe-flexible-opened-actions,
210
+ .layout > .acf-table > .acfe-flexible-opened-actions{
211
  background:#f9f9f9;
212
  border-top:1px solid #e1e1e1;
213
  padding:12px;
assets/acf-extended-fc.js CHANGED
@@ -38,13 +38,6 @@
38
 
39
  };
40
 
41
- model.acfeCloseLayoutInit = function($layout){
42
-
43
- $layout.addClass('-collapsed');
44
- acf.doAction('hide', $layout, 'collapse');
45
-
46
- };
47
-
48
  model.acfeLayoutInit = function($layout){
49
 
50
  // Get Flexible
@@ -54,70 +47,24 @@
54
  var $controls = $layout.find('> .acf-fc-layout-controls');
55
  var $handle = $layout.find('> .acf-fc-layout-handle');
56
 
57
- // Remove duplicate
58
- $layout.find('> .acfe-flexible-opened-actions').remove();
59
-
60
  // Placeholder
61
- var $placeholder = $layout.find('> .acfe-flexible-collapsed-placeholder');
62
-
63
- // Placeholder: Not found - Create new element
64
- if(!$placeholder.length && (flexible.has('acfeFlexiblePlaceholder') || flexible.has('acfeFlexiblePreview'))){
65
-
66
- var placeholder_icon = 'dashicons dashicons-edit';
67
-
68
- if(flexible.has('acfeFlexiblePlaceholderIcon'))
69
- placeholder_icon = flexible.get('acfeFlexiblePlaceholderIcon');
70
-
71
- // Placeholder
72
- var $placeholder = $('' +
73
- '<div class="acfe-flexible-collapsed-placeholder" title="Edit layout">' +
74
- ' <button class="button" onclick="return false;">' +
75
- ' <span class="' + placeholder_icon + '"></span>' +
76
- ' </button>' +
77
- ' <div class="acfe-flexible-collapsed-overlay"></div>' +
78
- ' <div class="acfe-flexible-placeholder"></div>' +
79
- '</div>'
80
- ).insertAfter($controls);
81
-
82
- }
83
 
84
  // Placeholder: Show
85
- $placeholder.show();
86
 
87
- // Modal Edition Wrap
88
- if(flexible.has('acfeFlexibleModalEdition')){
89
 
90
- if(!$layout.find('> .acfe-modal').length){
91
 
92
- // Wrap content
93
- $layout.find('> .acf-fields, > .acf-table').wrapAll('<div class="acfe-modal"><div class="acfe-modal-wrapper"><div class="acfe-modal-content"></div></div></div>');
94
-
95
- // Handle
96
- $handle.attr('data-action', 'acfe-flexible-modal-edit');
97
-
98
- // Placeholder
99
- if(flexible.has('acfeFlexiblePlaceholder') || flexible.has('acfeFlexiblePreview'))
100
- $placeholder.attr('data-action', 'acfe-flexible-modal-edit');
101
-
102
- }
103
-
104
- }
105
-
106
- else{
107
-
108
- if(!flexible.isLayoutClosed($layout)){
109
-
110
- $placeholder.hide();
111
-
112
- }
113
-
114
  }
115
 
116
  // Flexible has Preview
117
- if(flexible.has('acfeFlexiblePreview')){
118
 
119
- $placeholder.addClass('acfe-flexible-collapsed-preview acfe-is-loading').find('> .acfe-flexible-placeholder').prepend('<span class="spinner"></span>');
120
- $placeholder.find('> .acfe-flexible-collapsed-overlay').addClass('-hover');
121
 
122
  // vars
123
  var $input = $layout.children('input');
@@ -152,7 +99,7 @@
152
 
153
  }else{
154
 
155
- $placeholder.removeClass('acfe-flexible-collapsed-preview');
156
 
157
  }
158
 
@@ -165,8 +112,8 @@
165
  },
166
  complete: function(){
167
 
168
- $placeholder.find('> .acfe-flexible-collapsed-overlay').removeClass('-hover');
169
- $placeholder.removeClass('acfe-is-loading').find('> .acfe-flexible-placeholder > .spinner').remove();
170
 
171
  }
172
  });
@@ -175,6 +122,42 @@
175
 
176
  };
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  /*
179
  * Spawn
180
  */
@@ -198,14 +181,6 @@
198
 
199
  });
200
 
201
- // ACFE: Stylised button
202
- if(flexible.has('acfeFlexibleStylisedButton')){
203
-
204
- flexible.$button().removeClass('button-primary');
205
- flexible.$actions().wrap('<div class="acfe-flexible-stylised-button" />');
206
-
207
- }
208
-
209
  // ACFE: 1 layout available - OneClick
210
  if($clones.length === 1){
211
 
@@ -217,66 +192,105 @@
217
 
218
  }
219
 
220
- flexible.addEvents({'click .acfe-flexible-collapsed-placeholder': 'onClickCollapse'});
221
 
222
  flexible.addEvents({'click .acfe-flexible-opened-actions > a': 'onClickCollapse'});
223
-
224
- });
225
-
226
- acf.addAction('acfe/flexible/layouts', function($layout, flexible){
227
-
228
- // Flexible has Modal Edition
229
- if(flexible.has('acfeFlexibleModalEdition')){
230
-
231
- $layout.addClass('-collapsed');
232
- flexible.acfeLayoutInit($layout);
233
-
234
- return;
235
-
236
- }
237
-
238
- // Flexible has Remove Collapse
239
- if(flexible.has('acfeFlexibleRemoveCollapse')){
240
-
241
- flexible.removeEvents({'click [data-name="collapse-layout"]': 'onClickCollapse'});
242
- $layout.find('> .acf-fc-layout-controls > [data-name="collapse-layout"]').remove();
243
-
244
- }
245
 
246
- // Bail early if layout is clone
247
- if($layout.is('.acf-clone'))
248
- return;
249
 
250
- // Layout State: Collapse
251
- if(flexible.has('acfeFlexibleClose')){
252
-
253
- flexible.acfeCloseLayoutInit($layout);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
255
  }
 
 
 
 
256
 
257
- // Layout State: Open
258
- else if(flexible.has('acfeFlexibleOpen')){
259
-
260
- flexible.openLayout($layout);
261
-
262
- }
263
 
264
- // Others
265
- else{
266
 
267
- // Action: Close for closed layouts
268
- if(flexible.isLayoutClosed($layout)){
269
-
270
- flexible.acfeCloseLayoutInit($layout);
271
-
272
- }
273
-
274
- // Action: Show for opened layouts
275
- else{
276
-
277
- flexible.openLayout($layout);
278
-
279
- }
280
 
281
  }
282
 
@@ -289,19 +303,14 @@
289
 
290
  var flexible = acf.getInstance($layout.closest('.acf-field-flexible-content'));
291
 
292
- // Bail early if Modal Edit
293
- if(flexible.has('acfeFlexibleModalEdition'))
294
- return;
295
-
296
- // Placeholder
297
- $layout.find('> .acfe-flexible-collapsed-placeholder').hide();
298
 
299
- // Close Button
300
- if(flexible.has('acfeFlexibleCloseButton')){
301
-
302
- $layout.find('> .acfe-flexible-opened-actions').remove();
303
-
304
- $('<div class="acfe-flexible-opened-actions"><a href="javascript:void(0);" class="button">' + acf.get('close') + '</button></a>').appendTo($layout);
305
 
306
  }
307
 
@@ -315,37 +324,63 @@
315
  // Get Flexible
316
  var flexible = acf.getInstance($layout.closest('.acf-field-flexible-content'));
317
 
 
 
 
 
 
 
 
 
318
  flexible.acfeLayoutInit($layout);
319
 
320
  });
321
 
322
  acf.addAction('append', function($el){
323
 
324
- // Bail early if layout is not clone
325
  if(!$el.is('.layout'))
326
  return;
327
 
328
  // Get Flexible
329
  var flexible = acf.getInstance($el.closest('.acf-field-flexible-content'));
330
 
331
- flexible.acfeLayoutInit($el);
332
-
333
- // Scroll to new layout
334
- $('html, body').animate({
335
- scrollTop: parseInt($el.offset().top) - 200
336
- }, 200);
337
-
338
- // Modal Edition: Open
339
- if(flexible.has('acfeFlexibleModalEdition') && !$el.is('.acfe-layout-duplicated')){
340
 
341
- $el.find('> [data-action="acfe-flexible-modal-edit"]:first').trigger('click');
 
 
 
 
 
 
 
 
 
 
 
 
342
 
343
  }
344
 
345
- // Normal Edition: Open
346
- else if(!flexible.isLayoutClosed($el)){
 
 
 
 
 
 
 
 
 
 
347
 
348
- flexible.openLayout($el);
 
 
 
349
 
350
  }
351
 
38
 
39
  };
40
 
 
 
 
 
 
 
 
41
  model.acfeLayoutInit = function($layout){
42
 
43
  // Get Flexible
47
  var $controls = $layout.find('> .acf-fc-layout-controls');
48
  var $handle = $layout.find('> .acf-fc-layout-handle');
49
 
 
 
 
50
  // Placeholder
51
+ var $placeholder = $layout.find('> .acfe-fc-placeholder');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  // Placeholder: Show
54
+ $placeholder.removeClass('acf-hidden');
55
 
56
+ // If no modal edition & opened: Hide Placeholder
57
+ if(!flexible.has('acfeFlexibleModalEdition') && !flexible.isLayoutClosed($layout)){
58
 
59
+ $placeholder.addClass('acf-hidden');
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  // Flexible has Preview
64
+ if(flexible.isLayoutClosed($layout) && flexible.has('acfeFlexiblePreview') && !$placeholder.hasClass('-loading')){
65
 
66
+ $placeholder.addClass('acfe-fc-preview -loading').find('> .acfe-flexible-placeholder').prepend('<span class="spinner"></span>');
67
+ $placeholder.find('> .acfe-fc-overlay').addClass('-hover');
68
 
69
  // vars
70
  var $input = $layout.children('input');
99
 
100
  }else{
101
 
102
+ $placeholder.removeClass('acfe-fc-preview');
103
 
104
  }
105
 
112
  },
113
  complete: function(){
114
 
115
+ $placeholder.find('> .acfe-fc-overlay').removeClass('-hover');
116
+ $placeholder.removeClass('-loading').find('> .acfe-flexible-placeholder > .spinner').remove();
117
 
118
  }
119
  });
122
 
123
  };
124
 
125
+ model.acfeEditorsInit = function($layout){
126
+
127
+ var flexible = this;
128
+
129
+ // Closed
130
+ if(flexible.isLayoutClosed($layout))
131
+ return;
132
+
133
+ // Try to find delayed WYSIWYG
134
+ var editors = acf.getFields({
135
+ 'type': 'wysiwyg',
136
+ 'parent': $layout
137
+ });
138
+
139
+ if(!editors.length)
140
+ return;
141
+
142
+ $.each(editors, function(){
143
+
144
+ var editor = this;
145
+ var $wrap = editor.$control();
146
+
147
+ if($wrap.hasClass('delay')){
148
+
149
+ $wrap.removeClass('delay');
150
+ $wrap.find('.acf-editor-toolbar').remove();
151
+
152
+ // initialize
153
+ editor.initializeEditor();
154
+
155
+ }
156
+
157
+ });
158
+
159
+ };
160
+
161
  /*
162
  * Spawn
163
  */
181
 
182
  });
183
 
 
 
 
 
 
 
 
 
184
  // ACFE: 1 layout available - OneClick
185
  if($clones.length === 1){
186
 
192
 
193
  }
194
 
195
+ flexible.addEvents({'click .acfe-fc-placeholder': 'onClickCollapse'});
196
 
197
  flexible.addEvents({'click .acfe-flexible-opened-actions > a': 'onClickCollapse'});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
+ // Flexible: Ajax
200
+ if(flexible.has('acfeFlexibleAjax')){
 
201
 
202
+ flexible.add = function(args){
203
+
204
+ // Get Flexible
205
+ var flexible = this;
206
+
207
+ // defaults
208
+ args = acf.parseArgs(args, {
209
+ layout: '',
210
+ before: false
211
+ });
212
+
213
+ // validate
214
+ if( !this.allowAdd() ) {
215
+ return false;
216
+ }
217
+
218
+ // ajax
219
+ $.ajax({
220
+ url: acf.get('ajaxurl'),
221
+ data: acf.prepareForAjax({
222
+ action: 'acfe/advanced_flexible_content/models',
223
+ field_key: this.get('key'),
224
+ layout: args.layout,
225
+ }),
226
+ dataType: 'html',
227
+ type: 'post',
228
+ beforeSend: function(){
229
+ $('body').addClass('-loading');
230
+ },
231
+ success: function(html){
232
+ if(html){
233
+
234
+ var $layout = $(html);
235
+ var uniqid = acf.uniqid();
236
+
237
+ var search = 'acf[' + flexible.get('key') + '][acfcloneindex]';
238
+ var replace = flexible.$control().find('> input[type=hidden]').attr('name') + '[' + uniqid + ']';
239
+
240
+ // add row
241
+ var $el = acf.duplicate({
242
+ target: $layout,
243
+ search: search,
244
+ replace: replace,
245
+ append: flexible.proxy(function( $el, $el2 ){
246
+
247
+ // append
248
+ if( args.before ) {
249
+ args.before.before( $el2 );
250
+ } else {
251
+ flexible.$layoutsWrap().append( $el2 );
252
+ }
253
+
254
+ // enable
255
+ acf.enable( $el2, flexible.cid );
256
+
257
+ // render
258
+ flexible.render();
259
+ })
260
+ });
261
+
262
+ // Fix data-id
263
+ $el.attr('data-id', uniqid);
264
+
265
+ // trigger change for validation errors
266
+ flexible.$input().trigger('change');
267
+
268
+ // return
269
+ return $el;
270
+
271
+ }
272
+ },
273
+ 'complete': function(){
274
+ $('body').removeClass('-loading');
275
+ }
276
+ });
277
+
278
+ };
279
 
280
  }
281
+
282
+ });
283
+
284
+ acf.addAction('acfe/flexible/layouts', function($layout, flexible){
285
 
286
+ // TinyMCE Init
287
+ flexible.acfeEditorsInit($layout);
 
 
 
 
288
 
289
+ // Closed
290
+ if(flexible.isLayoutClosed($layout)){
291
 
292
+ // Placeholder
293
+ $layout.find('> .acfe-fc-placeholder').removeClass('acf-hidden');
 
 
 
 
 
 
 
 
 
 
 
294
 
295
  }
296
 
303
 
304
  var flexible = acf.getInstance($layout.closest('.acf-field-flexible-content'));
305
 
306
+ // TinyMCE Init
307
+ flexible.acfeEditorsInit($layout);
 
 
 
 
308
 
309
+ // Hide Placeholder
310
+ if(!flexible.has('acfeFlexibleModalEdition')){
311
+
312
+ // Placeholder
313
+ $layout.find('> .acfe-fc-placeholder').addClass('acf-hidden');
 
314
 
315
  }
316
 
324
  // Get Flexible
325
  var flexible = acf.getInstance($layout.closest('.acf-field-flexible-content'));
326
 
327
+ // Remove Ajax Title
328
+ if(flexible.has('acfeFlexibleRemoveAjaxTitle')){
329
+
330
+ flexible.renderLayout = function($layout){};
331
+
332
+ }
333
+
334
+ // Preview Ajax
335
  flexible.acfeLayoutInit($layout);
336
 
337
  });
338
 
339
  acf.addAction('append', function($el){
340
 
341
+ // Bail early if layout is not layout
342
  if(!$el.is('.layout'))
343
  return;
344
 
345
  // Get Flexible
346
  var flexible = acf.getInstance($el.closest('.acf-field-flexible-content'));
347
 
348
+ // Open Layout
349
+ if(!$el.is('.acfe-layout-duplicated')){
 
 
 
 
 
 
 
350
 
351
+ // Modal Edition: Open
352
+ if(flexible.has('acfeFlexibleModalEdition')){
353
+
354
+ $el.find('> [data-action="acfe-flexible-modal-edit"]:first').trigger('click');
355
+
356
+ }
357
+
358
+ // Normal Edition: Open
359
+ else{
360
+
361
+ flexible.openLayout($el);
362
+
363
+ }
364
 
365
  }
366
 
367
+ flexible.acfeLayoutInit($el);
368
+
369
+ var $modal = flexible.$el.closest('.acfe-modal.-open');
370
+
371
+ if($modal.length){
372
+
373
+ // Scroll to new layout
374
+ $modal.find('> .acfe-modal-wrapper > .acfe-modal-content').animate({
375
+ scrollTop: parseInt($el.offset().top) - 200
376
+ }, 200);
377
+
378
+ }else{
379
 
380
+ // Scroll to new layout
381
+ $('html, body').animate({
382
+ scrollTop: parseInt($el.offset().top) - 200
383
+ }, 200);
384
 
385
  }
386
 
assets/acf-extended-fg.css CHANGED
@@ -161,6 +161,10 @@ body.acf-admin-5-3 .acf-field-setting-fc_layout .acf-input-wrap.select{
161
  border-color: #7e8993;
162
  }
163
 
 
 
 
 
164
  .acf-field-acfe-flexible-modal > .acf-input > .acf-fields{
165
  border:0;
166
  }
161
  border-color: #7e8993;
162
  }
163
 
164
+ body.acf-admin-5-3 .acf-field-setting-fc_layout .acf-input-wrap.select select{
165
+ min-height: 28px;
166
+ }
167
+
168
  .acf-field-acfe-flexible-modal > .acf-input > .acf-fields{
169
  border:0;
170
  }
assets/acf-extended-fields.js CHANGED
@@ -160,8 +160,14 @@ function acfe_recaptcha(){
160
  this.mode = this.$control().data('mode');
161
  this.lines = this.$control().data('lines');
162
  this.indentUnit = this.$control().data('indent_unit');
163
-
164
- this.editor = wp.CodeMirror.fromTextArea(this.input(), {
 
 
 
 
 
 
165
  lineNumbers: this.lines,
166
  lineWrapping: true,
167
  styleActiveLine: false,
@@ -170,7 +176,6 @@ function acfe_recaptcha(){
170
  tabSize: 1,
171
  indentWithTabs: true,
172
  mode: this.mode,
173
- //mode: 'htmlmixed',
174
  extraKeys: {
175
  Tab: function(cm){
176
  cm.execCommand("indentMore")
@@ -179,21 +184,30 @@ function acfe_recaptcha(){
179
  cm.execCommand("indentLess")
180
  },
181
  },
182
- });
 
 
 
 
 
 
 
 
 
183
 
184
  if(this.rows){
185
 
186
- this.editor.getScrollerElement().style.minHeight = this.rows * 22 + 'px';
187
 
188
- this.editor.refresh();
189
 
190
  }
191
 
192
  field = this;
193
 
194
- this.editor.on('change', function(){
195
 
196
- field.editor.save();
197
 
198
  });
199
 
@@ -201,9 +215,9 @@ function acfe_recaptcha(){
201
 
202
  onShow: function(){
203
 
204
- if(this.editor){
205
 
206
- this.editor.refresh();
207
 
208
  }
209
 
@@ -213,6 +227,13 @@ function acfe_recaptcha(){
213
 
214
  acf.registerFieldType(CodeEditor);
215
 
 
 
 
 
 
 
 
216
  /**
217
  * Field: Textarea
218
  */
@@ -287,6 +308,13 @@ function acfe_recaptcha(){
287
 
288
  acf.registerFieldType(ACFE_Slug);
289
 
 
 
 
 
 
 
 
290
  /**
291
  * Field: Button
292
  */
@@ -721,6 +749,66 @@ function acfe_recaptcha(){
721
 
722
  });
723
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
724
  /**
725
  * Module: Author
726
  */
160
  this.mode = this.$control().data('mode');
161
  this.lines = this.$control().data('lines');
162
  this.indentUnit = this.$control().data('indent_unit');
163
+
164
+ var codeEditor = [];
165
+
166
+ // Default WP settings
167
+ var wpCodeMirror = wp.codeEditor.defaultSettings.codemirror;
168
+
169
+ // Field settings
170
+ var CodeMirror = {
171
  lineNumbers: this.lines,
172
  lineWrapping: true,
173
  styleActiveLine: false,
176
  tabSize: 1,
177
  indentWithTabs: true,
178
  mode: this.mode,
 
179
  extraKeys: {
180
  Tab: function(cm){
181
  cm.execCommand("indentMore")
184
  cm.execCommand("indentLess")
185
  },
186
  },
187
+ };
188
+
189
+ // Merge settings
190
+ var codeMirror = jQuery.extend(wpCodeMirror, CodeMirror);
191
+
192
+ // Push CodeMirror settings to codemirror property
193
+ codeEditor.codemirror = codeMirror;
194
+
195
+ // Init WP Code Editor
196
+ this.editor = wp.codeEditor.initialize(this.input(), codeEditor);
197
 
198
  if(this.rows){
199
 
200
+ this.editor.codemirror.getScrollerElement().style.minHeight = this.rows * 22 + 'px';
201
 
202
+ this.editor.codemirror.refresh();
203
 
204
  }
205
 
206
  field = this;
207
 
208
+ this.editor.codemirror.on('change', function(){
209
 
210
+ field.editor.codemirror.save();
211
 
212
  });
213
 
215
 
216
  onShow: function(){
217
 
218
+ if(this.editor.codemirror){
219
 
220
+ this.editor.codemirror.refresh();
221
 
222
  }
223
 
227
 
228
  acf.registerFieldType(CodeEditor);
229
 
230
+ acf.registerConditionForFieldType('equalTo', 'acfe_code_editor');
231
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_code_editor');
232
+ acf.registerConditionForFieldType('patternMatch', 'acfe_code_editor');
233
+ acf.registerConditionForFieldType('contains', 'acfe_code_editor');
234
+ acf.registerConditionForFieldType('hasValue', 'acfe_code_editor');
235
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_code_editor');
236
+
237
  /**
238
  * Field: Textarea
239
  */
308
 
309
  acf.registerFieldType(ACFE_Slug);
310
 
311
+ acf.registerConditionForFieldType('equalTo', 'acfe_slug');
312
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_slug');
313
+ acf.registerConditionForFieldType('patternMatch', 'acfe_slug');
314
+ acf.registerConditionForFieldType('contains', 'acfe_slug');
315
+ acf.registerConditionForFieldType('hasValue', 'acfe_slug');
316
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_slug');
317
+
318
  /**
319
  * Field: Button
320
  */
749
 
750
  });
751
 
752
+ /**
753
+ * Field: Forms
754
+ */
755
+ acf.registerConditionForFieldType('equalTo', 'acfe_forms');
756
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_forms');
757
+ acf.registerConditionForFieldType('patternMatch', 'acfe_forms');
758
+ acf.registerConditionForFieldType('contains', 'acfe_forms');
759
+ acf.registerConditionForFieldType('hasValue', 'acfe_forms');
760
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_forms');
761
+
762
+ /**
763
+ * Field: Post Status
764
+ */
765
+ acf.registerConditionForFieldType('equalTo', 'acfe_post_statuses');
766
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_post_statuses');
767
+ acf.registerConditionForFieldType('patternMatch', 'acfe_post_statuses');
768
+ acf.registerConditionForFieldType('contains', 'acfe_post_statuses');
769
+ acf.registerConditionForFieldType('hasValue', 'acfe_post_statuses');
770
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_post_statuses');
771
+
772
+ /**
773
+ * Field: Post Types
774
+ */
775
+ acf.registerConditionForFieldType('equalTo', 'acfe_post_types');
776
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_post_types');
777
+ acf.registerConditionForFieldType('patternMatch', 'acfe_post_types');
778
+ acf.registerConditionForFieldType('contains', 'acfe_post_types');
779
+ acf.registerConditionForFieldType('hasValue', 'acfe_post_types');
780
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_post_types');
781
+
782
+ /**
783
+ * Field: Taxonomies
784
+ */
785
+ acf.registerConditionForFieldType('equalTo', 'acfe_taxonomies');
786
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_taxonomies');
787
+ acf.registerConditionForFieldType('patternMatch', 'acfe_taxonomies');
788
+ acf.registerConditionForFieldType('contains', 'acfe_taxonomies');
789
+ acf.registerConditionForFieldType('hasValue', 'acfe_taxonomies');
790
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_taxonomies');
791
+
792
+ /**
793
+ * Field: Taxonomy Terms
794
+ */
795
+ acf.registerConditionForFieldType('equalTo', 'acfe_taxonomy_terms');
796
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_taxonomy_terms');
797
+ acf.registerConditionForFieldType('patternMatch', 'acfe_taxonomy_terms');
798
+ acf.registerConditionForFieldType('contains', 'acfe_taxonomy_terms');
799
+ acf.registerConditionForFieldType('hasValue', 'acfe_taxonomy_terms');
800
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_taxonomy_terms');
801
+
802
+ /**
803
+ * Field: User Roles
804
+ */
805
+ acf.registerConditionForFieldType('equalTo', 'acfe_user_roles');
806
+ acf.registerConditionForFieldType('notEqualTo', 'acfe_user_roles');
807
+ acf.registerConditionForFieldType('patternMatch', 'acfe_user_roles');
808
+ acf.registerConditionForFieldType('contains', 'acfe_user_roles');
809
+ acf.registerConditionForFieldType('hasValue', 'acfe_user_roles');
810
+ acf.registerConditionForFieldType('hasNoValue', 'acfe_user_roles');
811
+
812
  /**
813
  * Module: Author
814
  */
assets/acf-extended.css CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  /*
2
  * ACF: Field fix
3
  */
@@ -40,23 +47,26 @@
40
  * ACFE Field: Code Editor
41
  */
42
  .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap{
43
- border:1px solid #7e8993;
44
  height: auto;
45
  }
46
 
47
- body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap{
 
 
 
 
48
  border-color:#dfdfdf;
49
  }
50
 
51
- .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-activeline-background{
52
  background:#f9f9f9;
53
  }
54
 
55
- .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-selected{
56
  background:#f0f0f0 !important;
57
  }
58
 
59
- .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-gutters{
60
  background:#f9f9f9;
61
  }
62
 
@@ -70,36 +80,40 @@ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-w
70
  /*
71
  * ACF Field: Group
72
  */
73
- .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input,
74
- .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input{
75
  margin-left: -12px;
76
  margin-right: -12px;
77
  margin-bottom: -15px;
78
  }
79
- .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input,
80
- .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input{
81
  margin-top: -15px;
82
  }
83
- .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style.acfe-no-label > .acf-input > .acf-fields{
 
 
 
 
84
  border-width:0;
85
  }
86
- .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
87
  border-left-width:0;
88
  border-right-width:0;
89
  border-bottom-width:0;
90
  }
91
- .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields{
92
  border-width:0;
93
  }
94
 
95
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input{
96
  margin:0;
97
  }
98
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
99
  border-width:1px;
100
  }
101
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input,
102
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input{
103
  padding:0;
104
  padding-left:1px;
105
  margin-top: -15px;
@@ -107,8 +121,8 @@ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-w
107
  margin-left: 0;
108
  margin-right: 0;
109
  }
110
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
111
- .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input > .acf-table{
112
  border-width:0;
113
  }
114
 
@@ -117,57 +131,89 @@ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-w
117
  border-width:0;
118
  }
119
 
120
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input,
121
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input,
122
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-table{
123
  margin:0;
124
  }
125
 
126
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
127
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields,
128
- .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input > .acf-table{
129
  border-width:1px;
130
  }
131
 
132
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input,
133
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input,
134
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input{
135
  padding:0 12px;
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  /*
139
  * ACF Field: Clone
140
  */
141
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
142
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
143
  margin-left: -12px;
144
  margin-right: -12px;
145
  margin-bottom: -15px;
146
  }
147
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-no-label.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
148
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
149
  margin-top: -15px;
150
  }
151
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seemless-style > .acf-input > .acf-fields{
 
 
 
 
152
  border-width:0;
153
  }
154
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
155
  border-left-width:0;
156
  border-right-width:0;
157
  border-bottom-width:0;
158
  }
159
- .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields{
160
  border-width:0;
161
  }
162
 
163
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input{
164
  margin:0;
165
  }
166
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
167
  border-width:1px;
168
  }
169
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
170
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
171
  padding:0;
172
  padding-left:1px;
173
  margin-top: -15px;
@@ -175,8 +221,8 @@ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-w
175
  margin-left: 0;
176
  margin-right: 0;
177
  }
178
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
179
- .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input > .acf-table{
180
  border-width:0;
181
  }
182
 
@@ -185,24 +231,52 @@ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-w
185
  border-width:0;
186
  }
187
 
188
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input,
189
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input,
190
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-table{
191
  margin:0;
192
  }
193
 
194
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
195
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields,
196
- .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input > .acf-table{
197
  border-width:1px;
198
  }
199
 
200
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input,
201
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input,
202
- .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input{
203
  padding:0 12px;
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /*
207
  * ACFE Form
208
  */
1
+ /*
2
+ * Body Loading
3
+ */
4
+ body.-loading *{
5
+ cursor:wait !important;
6
+ }
7
+
8
  /*
9
  * ACF: Field fix
10
  */
47
  * ACFE Field: Code Editor
48
  */
49
  .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap{
 
50
  height: auto;
51
  }
52
 
53
+ .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap.cm-s-default{
54
+ border:1px solid #7e8993;
55
+ }
56
+
57
+ body:not(.acf-admin-5-3) .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap.cm-s-default{
58
  border-color:#dfdfdf;
59
  }
60
 
61
+ .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap.cm-s-default .CodeMirror-activeline-background{
62
  background:#f9f9f9;
63
  }
64
 
65
+ .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap.cm-s-default .CodeMirror-selected{
66
  background:#f0f0f0 !important;
67
  }
68
 
69
+ .acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap.cm-s-default .CodeMirror-gutters{
70
  background:#f9f9f9;
71
  }
72
 
80
  /*
81
  * ACF Field: Group
82
  */
83
+ .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style:not([data-acfe-group-modal="1"]) > .acf-input,
84
+ .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style:not([data-acfe-group-modal="1"]) > .acf-input{
85
  margin-left: -12px;
86
  margin-right: -12px;
87
  margin-bottom: -15px;
88
  }
89
+ .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input,
90
+ .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input{
91
  margin-top: -15px;
92
  }
93
+ .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-label > p.description,
94
+ .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-label > p.description{
95
+ margin-bottom: 15px;
96
+ }
97
+ .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style.acfe-no-label > .acf-input > .acf-fields{
98
  border-width:0;
99
  }
100
+ .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input > .acf-fields{
101
  border-left-width:0;
102
  border-right-width:0;
103
  border-bottom-width:0;
104
  }
105
+ .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style > .acf-input > .acf-fields{
106
  border-width:0;
107
  }
108
 
109
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input{
110
  margin:0;
111
  }
112
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input > .acf-fields{
113
  border-width:1px;
114
  }
115
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style:not([data-acfe-group-modal="1"]) > .acf-input,
116
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seamless-style:not([data-acfe-group-modal="1"]) > .acf-input{
117
  padding:0;
118
  padding-left:1px;
119
  margin-top: -15px;
121
  margin-left: 0;
122
  margin-right: 0;
123
  }
124
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style > .acf-input > .acf-fields,
125
+ .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seamless-style > .acf-input > .acf-table{
126
  border-width:0;
127
  }
128
 
131
  border-width:0;
132
  }
133
 
134
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style > .acf-input,
135
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input,
136
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seamless-style > .acf-table{
137
  margin:0;
138
  }
139
 
140
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style > .acf-input > .acf-fields,
141
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input > .acf-fields,
142
+ .acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seamless-style > .acf-input > .acf-table{
143
  border-width:1px;
144
  }
145
 
146
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seamless-style > .acf-input,
147
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seamless-style > .acf-input,
148
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seamless-style > .acf-input{
149
  padding:0 12px;
150
  }
151
 
152
+ /*
153
+ * ACF Field: Group - Terms
154
+ */
155
+ tr.acf-field.acf-field-group.acfe-seemless-style > td.acf-input > .acf-fields{
156
+ border: 0;
157
+ margin-left: -10px;
158
+ margin-right: -10px;
159
+ margin-top: -15px;
160
+ margin-bottom: -15px;
161
+ }
162
+
163
+ tr.acf-field.acf-field-group.acfe-seemless-style.acfe-field-group-layout-table > td.acf-input{
164
+ padding:0;
165
+ margin-top: -15px;
166
+ margin-bottom: -15px;
167
+ margin-left: 0;
168
+ margin-right: 0;
169
+ }
170
+
171
+ tr.acf-field.acf-field-group.acfe-seemless-style.acfe-field-group-layout-table > td.acf-input > .acf-table{
172
+ border-width:0;
173
+ }
174
+
175
+ tr.acf-field.acf-field-group[data-acfe-group-modal="1"] > .acf-input > .acfe-modal > .acfe-modal-wrapper > .acfe-modal-content > .acf-table,
176
+ tr.acf-field.acf-field-group[data-acfe-group-modal="1"] > .acf-input > .acfe-modal > .acfe-modal-wrapper > .acfe-modal-content > .acf-fields{
177
+ border-width:0;
178
+ }
179
+
180
  /*
181
  * ACF Field: Clone
182
  */
183
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
184
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
185
  margin-left: -12px;
186
  margin-right: -12px;
187
  margin-bottom: -15px;
188
  }
189
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-no-label.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
190
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
191
  margin-top: -15px;
192
  }
193
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style.acfe-no-label:not([data-acfe-clone-modal="1"]) > .acf-label > p.description,
194
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style.acfe-no-label:not([data-acfe-clone-modal="1"]) > .acf-label > p.description{
195
+ margin-bottom: 15px;
196
+ }
197
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seamless-style > .acf-input > .acf-fields{
198
  border-width:0;
199
  }
200
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input > .acf-fields{
201
  border-left-width:0;
202
  border-right-width:0;
203
  border-bottom-width:0;
204
  }
205
+ .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style > .acf-input > .acf-fields{
206
  border-width:0;
207
  }
208
 
209
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input{
210
  margin:0;
211
  }
212
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input > .acf-fields{
213
  border-width:1px;
214
  }
215
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
216
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seamless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
217
  padding:0;
218
  padding-left:1px;
219
  margin-top: -15px;
221
  margin-left: 0;
222
  margin-right: 0;
223
  }
224
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style > .acf-input > .acf-fields,
225
+ .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seamless-style > .acf-input > .acf-table{
226
  border-width:0;
227
  }
228
 
231
  border-width:0;
232
  }
233
 
234
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style > .acf-input,
235
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input,
236
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seamless-style > .acf-table{
237
  margin:0;
238
  }
239
 
240
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style > .acf-input > .acf-fields,
241
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input > .acf-fields,
242
+ .acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seamless-style > .acf-input > .acf-table{
243
  border-width:1px;
244
  }
245
 
246
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seamless-style > .acf-input,
247
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seamless-style > .acf-input,
248
+ .acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seamless-style > .acf-input{
249
  padding:0 12px;
250
  }
251
 
252
+ /*
253
+ * ACF Field: Clone - Terms
254
+ */
255
+ tr.acf-field.acf-field-clone.acfe-seemless-style > td.acf-input > .acf-fields{
256
+ border: 0;
257
+ margin-left: -10px;
258
+ margin-right: -10px;
259
+ margin-top: -15px;
260
+ margin-bottom: -15px;
261
+ }
262
+
263
+ tr.acf-field.acf-field-clone.acfe-seemless-style.acfe-field-clone-layout-table > td.acf-input{
264
+ padding:0;
265
+ margin-top: -15px;
266
+ margin-bottom: -15px;
267
+ margin-left: 0;
268
+ margin-right: 0;
269
+ }
270
+
271
+ tr.acf-field.acf-field-clone.acfe-seemless-style.acfe-field-clone-layout-table > td.acf-input > .acf-table{
272
+ border-width:0;
273
+ }
274
+
275
+ tr.acf-field.acf-field-clone[data-acfe-clone-modal="1"] > .acf-input > .acfe-modal > .acfe-modal-wrapper > .acfe-modal-content > .acf-table,
276
+ tr.acf-field.acf-field-clone[data-acfe-clone-modal="1"] > .acf-input > .acfe-modal > .acfe-modal-wrapper > .acfe-modal-content > .acf-fields{
277
+ border-width:0;
278
+ }
279
+
280
  /*
281
  * ACFE Form
282
  */
assets/acf-extended.js CHANGED
@@ -19,6 +19,7 @@
19
  footer: false,
20
  size: false,
21
  destroy: false,
 
22
  onClose: false,
23
  });
24
 
@@ -97,6 +98,8 @@
97
 
98
  acfe.modal.multiple();
99
 
 
 
100
  return $target;
101
 
102
  },
@@ -156,6 +159,15 @@
156
 
157
  },
158
 
 
 
 
 
 
 
 
 
 
159
  onClose: function($target, args){
160
 
161
  if(!args.onClose || !(args.onClose instanceof Function))
@@ -165,6 +177,8 @@
165
 
166
  }
167
 
 
 
168
  };
169
 
170
  acf.addAction('ready_field', function(field){
19
  footer: false,
20
  size: false,
21
  destroy: false,
22
+ onOpen: false,
23
  onClose: false,
24
  });
25
 
98
 
99
  acfe.modal.multiple();
100
 
101
+ acfe.modal.onOpen($target, args);
102
+
103
  return $target;
104
 
105
  },
159
 
160
  },
161
 
162
+ onOpen: function($target, args){
163
+
164
+ if(!args.onOpen || !(args.onOpen instanceof Function))
165
+ return;
166
+
167
+ args.onOpen($target);
168
+
169
+ },
170
+
171
  onClose: function($target, args){
172
 
173
  if(!args.onClose || !(args.onClose instanceof Function))
177
 
178
  }
179
 
180
+
181
+
182
  };
183
 
184
  acf.addAction('ready_field', function(field){
includes/core/compatibility.php CHANGED
@@ -39,6 +39,8 @@ class acfe_compatibility{
39
 
40
  add_filter('acf/validate_field_group', array($this, 'field_group_location_list'), 20);
41
  add_filter('acf/validate_field', array($this, 'field_acfe_update'), 20);
 
 
42
  add_filter('pto/posts_orderby/ignore', array($this, 'pto_acf_field_group'), 10, 3);
43
  add_action('admin_menu', array($this, 'cotto_submenu'), 999);
44
  add_filter('rank_math/metabox/priority', array($this, 'rankmath_metaboxes_priority'));
@@ -101,6 +103,22 @@ class acfe_compatibility{
101
 
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Plugin: Post Types Order
106
  * https://wordpress.org/plugins/post-types-order/
39
 
40
  add_filter('acf/validate_field_group', array($this, 'field_group_location_list'), 20);
41
  add_filter('acf/validate_field', array($this, 'field_acfe_update'), 20);
42
+ add_filter('acf/validate_field/type=group', array($this, 'field_acfe_seamless_style'), 20);
43
+ add_filter('acf/validate_field/type=clone', array($this, 'field_acfe_seamless_style'), 20);
44
  add_filter('pto/posts_orderby/ignore', array($this, 'pto_acf_field_group'), 10, 3);
45
  add_action('admin_menu', array($this, 'cotto_submenu'), 999);
46
  add_filter('rank_math/metabox/priority', array($this, 'rankmath_metaboxes_priority'));
103
 
104
  }
105
 
106
+ /**
107
+ * ACF Extended: 0.8.5
108
+ * Field Group/Clone: Fixed typo "Seamless"
109
+ */
110
+ function field_acfe_seamless_style($field){
111
+
112
+ if($seamless = acf_maybe_get($field, 'acfe_seamless_style', false)){
113
+
114
+ $field['acfe_seamless_style'] = $seamless;
115
+
116
+ }
117
+
118
+ return $field;
119
+
120
+ }
121
+
122
  /**
123
  * Plugin: Post Types Order
124
  * https://wordpress.org/plugins/post-types-order/
includes/core/enqueue.php CHANGED
@@ -14,22 +14,22 @@ function acfe_enqueue_admin_scripts(){
14
  wp_enqueue_script('acf-input');
15
 
16
  // ACF Extended
17
- wp_enqueue_script('acf-extended', plugins_url('assets/acf-extended.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
18
- wp_enqueue_style('acf-extended', plugins_url('assets/acf-extended.css', ACFE_FILE), false, ACFE_VERSION);
19
- wp_enqueue_style('acf-extended-admin', plugins_url('assets/acf-extended-admin.css', ACFE_FILE), false, ACFE_VERSION);
20
 
21
  // Better Taxonomies
22
  if(acf_get_setting('acfe/modules/taxonomies')){
23
 
24
- wp_enqueue_style('acf-extended-taxonomies', plugins_url('assets/acf-extended-taxonomies.css', ACFE_FILE), false, ACFE_VERSION);
25
 
26
  }
27
 
28
  // ACF Extended: Field Groups only
29
  if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group'))){
30
 
31
- wp_enqueue_script('acf-extended-fg', plugins_url('assets/acf-extended-fg.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
32
- wp_enqueue_style('acf-extended-fg', plugins_url('assets/acf-extended-fg.css', ACFE_FILE), false, ACFE_VERSION);
33
 
34
  }
35
 
@@ -42,16 +42,16 @@ add_action('acf/enqueue_scripts', 'acfe_enqueue_scripts');
42
  function acfe_enqueue_scripts(){
43
 
44
  // ACF Extended
45
- wp_enqueue_script('acf-extended', plugins_url('assets/acf-extended.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
46
- wp_enqueue_style('acf-extended', plugins_url('assets/acf-extended.css', ACFE_FILE), false, ACFE_VERSION);
47
 
48
  // ACF Extended: Fields
49
- wp_enqueue_script('acf-extended-fields', plugins_url('assets/acf-extended-fields.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
50
 
51
  // Front only
52
  if(!is_admin()){
53
 
54
- wp_enqueue_script('acf-extended-form', plugins_url('assets/acf-extended-form.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
55
 
56
  }
57
 
@@ -64,31 +64,31 @@ add_action('acf/input/admin_enqueue_scripts', 'acfe_enqueue_admin_input_scripts'
64
  function acfe_enqueue_admin_input_scripts(){
65
 
66
  // ACF Extended: Modal
67
- wp_enqueue_style('acf-extended-modal', plugins_url('assets/acf-extended-modal.css', ACFE_FILE), false, ACFE_VERSION);
68
 
69
  // Do not enqueue on ACF Field Groups views
70
  if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group')))
71
  return;
72
 
73
  // ACF Extended: Repeater
74
- wp_enqueue_style('acf-extended-repeater', plugins_url('assets/acf-extended-repeater.css', ACFE_FILE), false, ACFE_VERSION);
75
- wp_enqueue_script('acf-extended-repeater', plugins_url('assets/acf-extended-repeater.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
76
 
77
  // ACF Extended: Flexible Content
78
- wp_enqueue_style('acf-extended-fc', plugins_url('assets/acf-extended-fc.css', ACFE_FILE), false, ACFE_VERSION);
79
- wp_enqueue_script('acf-extended-fc', plugins_url('assets/acf-extended-fc.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
80
 
81
  // ACF Extended: Flexible Content Control
82
- wp_enqueue_style('acf-extended-fc-control', plugins_url('assets/acf-extended-fc-control.css', ACFE_FILE), false, ACFE_VERSION);
83
- wp_enqueue_script('acf-extended-fc-control', plugins_url('assets/acf-extended-fc-control.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
84
 
85
  // ACF Extended: Flexible Content Modal Select
86
- wp_enqueue_style('acf-extended-fc-modal-select', plugins_url('assets/acf-extended-fc-modal-select.css', ACFE_FILE), false, ACFE_VERSION);
87
- wp_enqueue_script('acf-extended-fc-modal-select', plugins_url('assets/acf-extended-fc-modal-select.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
88
 
89
  // ACF Extended: Flexible Content Modal Edit
90
- wp_enqueue_style('acf-extended-fc-modal-edit', plugins_url('assets/acf-extended-fc-modal-edit.css', ACFE_FILE), false, ACFE_VERSION);
91
- wp_enqueue_script('acf-extended-fc-modal-edit', plugins_url('assets/acf-extended-fc-modal-edit.js', ACFE_FILE), array('jquery'), ACFE_VERSION);
92
 
93
  acf_localize_data(array(
94
  'close' => __('Close', 'acfe')
14
  wp_enqueue_script('acf-input');
15
 
16
  // ACF Extended
17
+ wp_enqueue_script('acf-extended', acfe_get_url('assets/acf-extended.js'), array('jquery'), ACFE_VERSION);
18
+ wp_enqueue_style('acf-extended', acfe_get_url('assets/acf-extended.css'), false, ACFE_VERSION);
19
+ wp_enqueue_style('acf-extended-admin', acfe_get_url('assets/acf-extended-admin.css'), false, ACFE_VERSION);
20
 
21
  // Better Taxonomies
22
  if(acf_get_setting('acfe/modules/taxonomies')){
23
 
24
+ wp_enqueue_style('acf-extended-taxonomies', acfe_get_url('assets/acf-extended-taxonomies.css'), false, ACFE_VERSION);
25
 
26
  }
27
 
28
  // ACF Extended: Field Groups only
29
  if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group'))){
30
 
31
+ wp_enqueue_script('acf-extended-fg', acfe_get_url('assets/acf-extended-fg.js'), array('jquery'), ACFE_VERSION);
32
+ wp_enqueue_style('acf-extended-fg', acfe_get_url('assets/acf-extended-fg.css'), false, ACFE_VERSION);
33
 
34
  }
35
 
42
  function acfe_enqueue_scripts(){
43
 
44
  // ACF Extended
45
+ wp_enqueue_script('acf-extended', acfe_get_url('assets/acf-extended.js'), array('jquery'), ACFE_VERSION);
46
+ wp_enqueue_style('acf-extended', acfe_get_url('assets/acf-extended.css'), false, ACFE_VERSION);
47
 
48
  // ACF Extended: Fields
49
+ wp_enqueue_script('acf-extended-fields', acfe_get_url('assets/acf-extended-fields.js'), array('jquery'), ACFE_VERSION);
50
 
51
  // Front only
52
  if(!is_admin()){
53
 
54
+ wp_enqueue_script('acf-extended-form', acfe_get_url('assets/acf-extended-form.js'), array('jquery'), ACFE_VERSION);
55
 
56
  }
57
 
64
  function acfe_enqueue_admin_input_scripts(){
65
 
66
  // ACF Extended: Modal
67
+ wp_enqueue_style('acf-extended-modal', acfe_get_url('assets/acf-extended-modal.css'), false, ACFE_VERSION);
68
 
69
  // Do not enqueue on ACF Field Groups views
70
  if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group')))
71
  return;
72
 
73
  // ACF Extended: Repeater
74
+ wp_enqueue_style('acf-extended-repeater', acfe_get_url('assets/acf-extended-repeater.css'), false, ACFE_VERSION);
75
+ wp_enqueue_script('acf-extended-repeater', acfe_get_url('assets/acf-extended-repeater.js'), array('jquery'), ACFE_VERSION);
76
 
77
  // ACF Extended: Flexible Content
78
+ wp_enqueue_style('acf-extended-fc', acfe_get_url('assets/acf-extended-fc.css'), false, ACFE_VERSION);
79
+ wp_enqueue_script('acf-extended-fc', acfe_get_url('assets/acf-extended-fc.js'), array('jquery'), ACFE_VERSION);
80
 
81
  // ACF Extended: Flexible Content Control
82
+ wp_enqueue_style('acf-extended-fc-control', acfe_get_url('assets/acf-extended-fc-control.css'), false, ACFE_VERSION);
83
+ wp_enqueue_script('acf-extended-fc-control', acfe_get_url('assets/acf-extended-fc-control.js'), array('jquery'), ACFE_VERSION);
84
 
85
  // ACF Extended: Flexible Content Modal Select
86
+ wp_enqueue_style('acf-extended-fc-modal-select', acfe_get_url('assets/acf-extended-fc-modal-select.css'), false, ACFE_VERSION);
87
+ wp_enqueue_script('acf-extended-fc-modal-select', acfe_get_url('assets/acf-extended-fc-modal-select.js'), array('jquery'), ACFE_VERSION);
88
 
89
  // ACF Extended: Flexible Content Modal Edit
90
+ wp_enqueue_style('acf-extended-fc-modal-edit', acfe_get_url('assets/acf-extended-fc-modal-edit.css'), false, ACFE_VERSION);
91
+ wp_enqueue_script('acf-extended-fc-modal-edit', acfe_get_url('assets/acf-extended-fc-modal-edit.js'), array('jquery'), ACFE_VERSION);
92
 
93
  acf_localize_data(array(
94
  'close' => __('Close', 'acfe')
includes/core/helpers.php CHANGED
@@ -16,6 +16,8 @@ function get_flexible($selector, $post_id = false){
16
  // Vars
17
  $field = acf_get_field($selector);
18
  $flexible = acf_get_field_type('flexible_content');
 
 
19
  $is_preview = false;
20
 
21
  // Actions
@@ -74,6 +76,86 @@ function has_flexible($selector, $post_id = false){
74
 
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * ACFE Flexible: Render Template
79
  */
16
  // Vars
17
  $field = acf_get_field($selector);
18
  $flexible = acf_get_field_type('flexible_content');
19
+
20
+ global $is_preview;
21
  $is_preview = false;
22
 
23
  // Actions
76
 
77
  }
78
 
79
+ /**
80
+ * Flexible: have_settings()
81
+ */
82
+ if(!function_exists('have_settings')){
83
+
84
+ function have_settings(){
85
+
86
+ return have_rows('layout_settings');
87
+
88
+ }
89
+
90
+ }
91
+
92
+ /**
93
+ * Flexible: the_settings()
94
+ */
95
+ if(!function_exists('the_setting')){
96
+
97
+ function the_setting(){
98
+
99
+ return the_row();
100
+
101
+ }
102
+
103
+ }
104
+
105
+ /**
106
+ * have_archive()
107
+ */
108
+ if(!function_exists('have_archive')){
109
+
110
+ $acfe_archive_i = 0;
111
+ function have_archive(){
112
+
113
+ global $acfe_archive_i;
114
+
115
+ if($acfe_archive_i == 0)
116
+ return true;
117
+
118
+ remove_filter('acf/pre_load_post_id', 'acfe_the_archive_post_id');
119
+
120
+ return false;
121
+
122
+ }
123
+
124
+ }
125
+
126
+ /**
127
+ * the_archive()
128
+ */
129
+ if(!function_exists('the_archive')){
130
+
131
+ function the_archive(){
132
+
133
+ global $acfe_archive_i;
134
+
135
+ add_filter('acf/pre_load_post_id', 'acfe_the_archive_post_id', 10, 2);
136
+
137
+ $acfe_archive_i++;
138
+
139
+ }
140
+
141
+ }
142
+
143
+ function acfe_the_archive_post_id($null, $post_id){
144
+
145
+ if($post_id !== false)
146
+ return $null;
147
+
148
+ $post_type = get_post_type();
149
+
150
+ if(empty($post_type))
151
+ return $null;
152
+
153
+ $null = $post_type . '_archive';
154
+
155
+ return $null;
156
+
157
+ }
158
+
159
  /**
160
  * ACFE Flexible: Render Template
161
  */
includes/field-groups/field-group.php CHANGED
@@ -638,7 +638,7 @@ function acfc_field_group_import_categories($field_group){
638
 
639
  if(!is_wp_error($new_term)){
640
 
641
- $new_term_id = $new_term->term_id;
642
 
643
  }
644
 
638
 
639
  if(!is_wp_error($new_term)){
640
 
641
+ $new_term_id = $new_term['term_id'];
642
 
643
  }
644
 
includes/field-groups/field-groups.php CHANGED
@@ -427,6 +427,14 @@ add_action('current_screen', function(){
427
  return;
428
 
429
  add_action('admin_footer', function(){
 
 
 
 
 
 
 
 
430
  ?>
431
 
432
  <!-- ACFE: Label -->
@@ -450,7 +458,7 @@ add_action('current_screen', function(){
450
  //$('#posts-filter').append($('#tmpl-acfe-debug').html());
451
 
452
  // Fix no field groups found
453
- $('#the-list tr.no-items td').attr('colspan', 9);
454
 
455
  })(jQuery);
456
  </script>
427
  return;
428
 
429
  add_action('admin_footer', function(){
430
+
431
+ $categories = get_terms(array(
432
+ 'taxonomy' => 'acf-field-group-category',
433
+ 'hide_empty' => false,
434
+ ));
435
+
436
+ $cols = !empty($categories) ? 9 : 8;
437
+
438
  ?>
439
 
440
  <!-- ACFE: Label -->
458
  //$('#posts-filter').append($('#tmpl-acfe-debug').html());
459
 
460
  // Fix no field groups found
461
+ $('#the-list tr.no-items td').attr('colspan', $('.wp-list-table > thead > tr > td:not(.hidden), .wp-list-table > thead > tr > th:not(.hidden)').length -1);
462
 
463
  })(jQuery);
464
  </script>
includes/fields/field-advanced-link.php CHANGED
@@ -322,7 +322,7 @@ function my_acf_advanced_link_fields($fields, $field, $value){
322
  return $valid;
323
 
324
  // URL is required
325
- if(empty($value) || (empty($value['url'] && empty($value['post']))))
326
  return false;
327
 
328
  // return
322
  return $valid;
323
 
324
  // URL is required
325
+ if(empty($value) || (!acf_maybe_get($value, 'url') && !acf_maybe_get($value, 'post')))
326
  return false;
327
 
328
  // return
includes/fields/field-clone.php CHANGED
@@ -7,9 +7,9 @@ add_action('acf/render_field_settings/type=clone', 'acfe_field_clone_settings');
7
  function acfe_field_clone_settings($field){
8
 
9
  acf_render_field_setting($field, array(
10
- 'label' => __('Seemless Style'),
11
- 'name' => 'acfe_seemless_style',
12
- 'key' => 'acfe_seemless_style',
13
  'instructions' => __('Enable better CSS integration: remove borders and padding'),
14
  'type' => 'true_false',
15
  'message' => '',
@@ -117,9 +117,9 @@ function acfe_field_clone_ajax_query($field_groups){
117
  add_filter('acf/prepare_field/type=clone', 'acfe_field_clone_type_class', 99);
118
  function acfe_field_clone_type_class($field){
119
 
120
- if(acf_maybe_get($field, 'acfe_seemless_style')){
121
 
122
- $field['wrapper']['class'] .= ' acfe-seemless-style';
123
 
124
  }
125
 
7
  function acfe_field_clone_settings($field){
8
 
9
  acf_render_field_setting($field, array(
10
+ 'label' => __('Seamless Style', 'acfe'),
11
+ 'name' => 'acfe_seamless_style',
12
+ 'key' => 'acfe_seamless_style',
13
  'instructions' => __('Enable better CSS integration: remove borders and padding'),
14
  'type' => 'true_false',
15
  'message' => '',
117
  add_filter('acf/prepare_field/type=clone', 'acfe_field_clone_type_class', 99);
118
  function acfe_field_clone_type_class($field){
119
 
120
+ if(acf_maybe_get($field, 'acfe_seamless_style')){
121
 
122
+ $field['wrapper']['class'] .= ' acfe-seamless-style';
123
 
124
  }
125
 
includes/fields/field-code-editor.php CHANGED
@@ -58,6 +58,7 @@ class acfe_field_code_editor extends acf_field{
58
  'instructions' => __('Appears when creating a new post','acf'),
59
  'type' => 'acfe_code_editor',
60
  'name' => 'default_value',
 
61
  ));
62
 
63
  // placeholder
@@ -66,6 +67,7 @@ class acfe_field_code_editor extends acf_field{
66
  'instructions' => __('Appears within the input','acf'),
67
  'type' => 'acfe_code_editor',
68
  'name' => 'placeholder',
 
69
  ));
70
 
71
  // Mode
58
  'instructions' => __('Appears when creating a new post','acf'),
59
  'type' => 'acfe_code_editor',
60
  'name' => 'default_value',
61
+ 'rows' => 4
62
  ));
63
 
64
  // placeholder
67
  'instructions' => __('Appears within the input','acf'),
68
  'type' => 'acfe_code_editor',
69
  'name' => 'placeholder',
70
+ 'rows' => 4
71
  ));
72
 
73
  // Mode
includes/fields/field-flexible-content.php CHANGED
@@ -14,7 +14,7 @@ function acfe_flexible_settings($field){
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,
@@ -84,6 +84,34 @@ function acfe_flexible_settings($field){
84
  'ui_off_text' => '',
85
  ));
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  // Layouts: Render
88
  acf_render_field_setting($field, array(
89
  'label' => __('Layouts: Render'),
@@ -144,6 +172,20 @@ function acfe_flexible_settings($field){
144
  )
145
  ));
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  // Layouts: Close Button
148
  acf_render_field_setting($field, array(
149
  'label' => __('Layouts: Close Button'),
@@ -317,6 +359,7 @@ function acfe_flexible_settings($field){
317
  'key' => 'acfe_flexible_layouts_state',
318
  'instructions' => __('Force layouts to be collapsed or opened'),
319
  'type' => 'select',
 
320
  'allow_null' => true,
321
  'choices' => array(
322
  'collapse' => 'Collapsed',
@@ -399,6 +442,7 @@ function acfe_flexible_layouts_settings($field){
399
  $layout = $field_flexible['layouts'][$_layout_key];
400
 
401
  $is_flexible_layouts_thumbnails = isset($field_flexible['acfe_flexible_layouts_thumbnails']) && !empty($field_flexible['acfe_flexible_layouts_thumbnails']);
 
402
  $is_flexible_layouts_templates = isset($field_flexible['acfe_flexible_layouts_templates']) && !empty($field_flexible['acfe_flexible_layouts_templates']);
403
  $is_flexible_modal_enabled = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']);
404
  $is_flexible_modal_categories = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']);
@@ -551,6 +595,45 @@ function acfe_flexible_layouts_settings($field){
551
 
552
  }
553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  }
555
 
556
  add_filter('acfe/field_wrapper_attributes/type=flexible_content', 'acfe_flexible_wrapper', 10, 2);
@@ -570,6 +653,13 @@ function acfe_flexible_wrapper($wrapper, $field){
570
 
571
  }
572
 
 
 
 
 
 
 
 
573
  // Modal: Edition
574
  if(acf_maybe_get($field, 'acfe_flexible_modal_edition')){
575
 
@@ -633,13 +723,6 @@ function acfe_flexible_wrapper($wrapper, $field){
633
  }
634
 
635
  }
636
-
637
- // Layouts Remove Collapse
638
- if(acf_maybe_get($field, 'acfe_flexible_layouts_remove_collapse')){
639
-
640
- $wrapper['data-acfe-flexible-remove-collapse'] = 1;
641
-
642
- }
643
 
644
  }
645
 
@@ -681,20 +764,8 @@ function acfe_flexible_wrapper($wrapper, $field){
681
 
682
  }
683
 
684
- // Remove actions
685
- $acfe_flexible_remove_actions = false;
686
- $acfe_flexible_remove_actions = apply_filters('acfe/flexible/remove_actions', $acfe_flexible_remove_actions, $field);
687
- $acfe_flexible_remove_actions = apply_filters('acfe/flexible/remove_actions/name=' . $field['_name'], $acfe_flexible_remove_actions, $field);
688
- $acfe_flexible_remove_actions = apply_filters('acfe/flexible/remove_actions/key=' . $field['key'], $acfe_flexible_remove_actions, $field);
689
-
690
- if($acfe_flexible_remove_actions){
691
-
692
- $wrapper['data-acfe-flexible-remove-actions'] = 1;
693
-
694
- }
695
-
696
  // Remove ajax 'layout_title' call
697
- $acfe_flexible_remove_ajax_title = false;
698
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title', $acfe_flexible_remove_ajax_title, $field);
699
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title/name=' . $field['_name'], $acfe_flexible_remove_ajax_title, $field);
700
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title/key=' . $field['key'], $acfe_flexible_remove_ajax_title, $field);
@@ -803,7 +874,7 @@ function acfe_flexible_layout_title_prepare($field){
803
  $category = '';
804
  if(isset($field['acfe_flexible_modal']['acfe_flexible_modal_categories']) && !empty($field['acfe_flexible_modal']['acfe_flexible_modal_categories']) && acf_maybe_get($layout, 'acfe_flexible_category')){
805
 
806
- $category = 'data-acfe-flexible-category="' . $layout['acfe_flexible_category'] . '"';
807
 
808
  }
809
 
@@ -846,6 +917,7 @@ function acfe_flexible_render_field($field){
846
  return;
847
 
848
  // Vars
 
849
  $is_preview = true;
850
 
851
  // Actions
@@ -864,17 +936,23 @@ function acfe_flexible_render_field($field){
864
  }
865
 
866
  add_action('wp_ajax_acfe/flexible/layout_preview', 'acfe_flexible_layout_preview');
867
- function acfe_flexible_layout_preview(){
868
-
869
- // Options
870
- $options = acf_parse_args($_POST, array(
871
- 'post_id' => 0,
872
- 'i' => 0,
873
- 'field_key' => '',
874
- 'nonce' => '',
875
- 'layout' => '',
876
- 'value' => array()
877
- ));
 
 
 
 
 
 
878
 
879
  // Load field
880
  $field = acf_get_field($options['field_key']);
@@ -901,24 +979,17 @@ function acfe_flexible_layout_preview(){
901
  $layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
902
  $layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
903
 
904
- $get_field_object = get_field_object($options['field_key'], $options['post_id'], false, false);
905
-
906
- $preview_key = 'preview_' . $options['field_key'];
907
- $get_field_object['key'] = $preview_key;
908
 
909
- acf_add_local_field($get_field_object);
910
 
911
- add_filter('acf/load_value/key=' . $preview_key, function($value, $post_id, $field) use($options){
912
-
913
- $value = array();
914
- $value[0] = wp_unslash($options['value']);
915
 
916
- return $value;
917
-
918
- }, 10, 3);
919
-
920
- if(have_rows($preview_key)):
921
- while(have_rows($preview_key)): the_row();
922
 
923
  // Flexible Preview
924
  do_action('acfe/flexible/preview/name=' . $field['_name'], $field, $layout);
@@ -932,10 +1003,16 @@ function acfe_flexible_layout_preview(){
932
  // ACFE: All Flexible Preview
933
  do_action('acfe/flexible/preview', $field, $layout);
934
 
 
 
935
  endwhile;
936
  endif;
937
 
938
- die;
 
 
 
 
939
 
940
  }
941
 
@@ -980,44 +1057,890 @@ function acfe_flexible_layout_render_script_setting($return, $field, $layout, $i
980
 
981
  }
982
 
983
- add_filter('acf/load_field/type=flexible_content', 'acfe_flexible_layout_title_subfield');
984
- function acfe_flexible_layout_title_subfield($field){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
 
986
- global $typenow;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
987
 
988
- if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group')) || (isset($typenow) && $typenow === 'acf-field-group'))
989
- return $field;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
990
 
991
- if(!acf_maybe_get($field, 'layouts'))
992
- return $field;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
993
 
994
- if(!acf_maybe_get($field, 'acfe_flexible_title_edition'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
995
  return $field;
 
 
996
 
997
- foreach($field['layouts'] as $layout_key => &$layout){
998
-
999
- // Add the input as the first sub_field
1000
- array_unshift($layout['sub_fields'] , array(
1001
- 'ID' => false,
1002
- 'label' => false,
1003
- 'key' => 'field_acfe_flexible_layout_title',
1004
- 'name' => 'acfe_flexible_layout_title',
1005
- '_name' => 'acfe_flexible_layout_title',
1006
- 'type' => 'text',
1007
- 'required' => 0,
1008
- 'maxlength' => null,
1009
- 'parent' => false,
1010
- 'default_value' => $layout['label'],
1011
- 'placeholder' => $layout['label'],
1012
- 'wrapper' => array(
1013
- 'id' => '',
1014
- 'class' => '',
1015
- 'width' => '',
1016
- )
1017
- ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1018
 
1019
  }
1020
 
1021
- return $field;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
 
1023
- }
 
 
 
 
14
  'label' => __('Stylised Button'),
15
  'name' => 'acfe_flexible_stylised_button',
16
  'key' => 'acfe_flexible_stylised_button',
17
+ 'instructions' => __('Better actions buttons integration'),
18
  'type' => 'true_false',
19
  'message' => '',
20
  'default_value' => false,
84
  'ui_off_text' => '',
85
  ));
86
 
87
+ // Layouts settings
88
+ acf_render_field_setting($field, array(
89
+ 'label' => __('Layouts: Settings'),
90
+ 'name' => 'acfe_flexible_layouts_settings',
91
+ 'key' => 'acfe_flexible_layouts_settings',
92
+ 'instructions' => __('Choose a field group to clone and to be used as a configuration modal'),
93
+ 'type' => 'true_false',
94
+ 'message' => '',
95
+ 'default_value' => false,
96
+ 'ui' => true,
97
+ 'ui_on_text' => '',
98
+ 'ui_off_text' => '',
99
+ ));
100
+
101
+ // Layouts ajax
102
+ acf_render_field_setting($field, array(
103
+ 'label' => __('Layouts: Asynchronous'),
104
+ 'name' => 'acfe_flexible_layouts_ajax',
105
+ 'key' => 'acfe_flexible_layouts_ajax',
106
+ 'instructions' => __('Add layouts using Ajax method. This setting increase performance on complex Flexible Content'),
107
+ 'type' => 'true_false',
108
+ 'message' => '',
109
+ 'default_value' => false,
110
+ 'ui' => true,
111
+ 'ui_on_text' => '',
112
+ 'ui_off_text' => '',
113
+ ));
114
+
115
  // Layouts: Render
116
  acf_render_field_setting($field, array(
117
  'label' => __('Layouts: Render'),
172
  )
173
  ));
174
 
175
+ // Disable Legacy Title Ajax
176
+ acf_render_field_setting($field, array(
177
+ 'label' => __('Disable Legacy Layout Title Ajax'),
178
+ 'name' => 'acfe_flexible_disable_ajax_title',
179
+ 'key' => 'acfe_flexible_disable_ajax_title',
180
+ 'instructions' => __('Disable the additional ACF Layout Title Ajax call. If you don\'t perform operations using <code>acf/fields/flexible_content/layout_title</code> you can turn this setting on. <br /><br />More informations can be found on the <a href="https://www.advancedcustomfields.com/resources/acf-fields-flexible_content-layout_title/" target="_blank">ACF documentation</a>.'),
181
+ 'type' => 'true_false',
182
+ 'message' => '',
183
+ 'default_value' => false,
184
+ 'ui' => true,
185
+ 'ui_on_text' => '',
186
+ 'ui_off_text' => '',
187
+ ));
188
+
189
  // Layouts: Close Button
190
  acf_render_field_setting($field, array(
191
  'label' => __('Layouts: Close Button'),
359
  'key' => 'acfe_flexible_layouts_state',
360
  'instructions' => __('Force layouts to be collapsed or opened'),
361
  'type' => 'select',
362
+ 'placeholder' => __('Default', 'acfe'),
363
  'allow_null' => true,
364
  'choices' => array(
365
  'collapse' => 'Collapsed',
442
  $layout = $field_flexible['layouts'][$_layout_key];
443
 
444
  $is_flexible_layouts_thumbnails = isset($field_flexible['acfe_flexible_layouts_thumbnails']) && !empty($field_flexible['acfe_flexible_layouts_thumbnails']);
445
+ $is_flexible_layouts_settings = isset($field_flexible['acfe_flexible_layouts_settings']) && !empty($field_flexible['acfe_flexible_layouts_settings']);
446
  $is_flexible_layouts_templates = isset($field_flexible['acfe_flexible_layouts_templates']) && !empty($field_flexible['acfe_flexible_layouts_templates']);
447
  $is_flexible_modal_enabled = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_enabled']);
448
  $is_flexible_modal_categories = isset($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']) && !empty($field_flexible['acfe_flexible_modal']['acfe_flexible_modal_categories']);
595
 
596
  }
597
 
598
+ // Settings
599
+ if($is_flexible_layouts_settings){
600
+
601
+ $acfe_flexible_settings = isset($layout['acfe_flexible_settings']) ? $layout['acfe_flexible_settings'] : '';
602
+
603
+ acf_disable_filters();
604
+
605
+ $choices = array();
606
+
607
+ $field_groups = acf_get_field_groups();
608
+ if(!empty($field_groups)){
609
+
610
+ foreach($field_groups as $field_group){
611
+
612
+ $choices[$field_group['key']] = $field_group['title'];
613
+
614
+ }
615
+
616
+ }
617
+
618
+ acf_enable_filters();
619
+
620
+ acf_render_field_wrap(array(
621
+ 'label' => __('Configuration modal'),
622
+ 'name' => 'acfe_flexible_settings',
623
+ 'type' => 'select',
624
+ 'class' => '',
625
+ 'prefix' => $layout_prefix,
626
+ 'value' => $acfe_flexible_settings,
627
+ 'choices' => $choices,
628
+ 'allow_null' => 1,
629
+ 'multiple' => 0,
630
+ 'ui' => 1,
631
+ 'ajax' => 0,
632
+ 'return_format' => 0,
633
+ ), 'ul');
634
+
635
+ }
636
+
637
  }
638
 
639
  add_filter('acfe/field_wrapper_attributes/type=flexible_content', 'acfe_flexible_wrapper', 10, 2);
653
 
654
  }
655
 
656
+ // Ajax
657
+ if(acf_maybe_get($field, 'acfe_flexible_layouts_ajax')){
658
+
659
+ $wrapper['data-acfe-flexible-ajax'] = 1;
660
+
661
+ }
662
+
663
  // Modal: Edition
664
  if(acf_maybe_get($field, 'acfe_flexible_modal_edition')){
665
 
723
  }
724
 
725
  }
 
 
 
 
 
 
 
726
 
727
  }
728
 
764
 
765
  }
766
 
 
 
 
 
 
 
 
 
 
 
 
 
767
  // Remove ajax 'layout_title' call
768
+ $acfe_flexible_remove_ajax_title = acf_maybe_get($field, 'acfe_flexible_disable_ajax_title', false);
769
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title', $acfe_flexible_remove_ajax_title, $field);
770
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title/name=' . $field['_name'], $acfe_flexible_remove_ajax_title, $field);
771
  $acfe_flexible_remove_ajax_title = apply_filters('acfe/flexible/remove_ajax_title/key=' . $field['key'], $acfe_flexible_remove_ajax_title, $field);
874
  $category = '';
875
  if(isset($field['acfe_flexible_modal']['acfe_flexible_modal_categories']) && !empty($field['acfe_flexible_modal']['acfe_flexible_modal_categories']) && acf_maybe_get($layout, 'acfe_flexible_category')){
876
 
877
+ $category = 'data-acfe-flexible-category="' . trim($layout['acfe_flexible_category']) . '"';
878
 
879
  }
880
 
917
  return;
918
 
919
  // Vars
920
+ global $is_preview;
921
  $is_preview = true;
922
 
923
  // Actions
936
  }
937
 
938
  add_action('wp_ajax_acfe/flexible/layout_preview', 'acfe_flexible_layout_preview');
939
+ function acfe_flexible_layout_preview($args = array()){
940
+
941
+ $options = $args;
942
+
943
+ if(empty($options)){
944
+
945
+ // Options
946
+ $options = acf_parse_args($_POST, array(
947
+ 'post_id' => 0,
948
+ 'i' => 0,
949
+ 'field_key' => '',
950
+ 'nonce' => '',
951
+ 'layout' => '',
952
+ 'value' => array()
953
+ ));
954
+
955
+ }
956
 
957
  // Load field
958
  $field = acf_get_field($options['field_key']);
979
  $layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/name=' . $field['_name'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
980
  $layout['acfe_flexible_thumbnail'] = apply_filters('acfe/flexible/layout/thumbnail/key=' . $field['key'] . '&layout=' . $layout['name'], $layout['acfe_flexible_thumbnail'], $field, $layout);
981
 
982
+ $meta = array($options['field_key'] => array(
983
+ wp_unslash($options['value'])
984
+ ));
 
985
 
986
+ acf_setup_meta($meta, $options['field_key'] . '_' . $options['i'], true);
987
 
988
+ if(have_rows($options['field_key'])):
989
+ while(have_rows($options['field_key'])): the_row();
 
 
990
 
991
+ global $post;
992
+ $_post = $post;
 
 
 
 
993
 
994
  // Flexible Preview
995
  do_action('acfe/flexible/preview/name=' . $field['_name'], $field, $layout);
1003
  // ACFE: All Flexible Preview
1004
  do_action('acfe/flexible/preview', $field, $layout);
1005
 
1006
+ $post = $_post;
1007
+
1008
  endwhile;
1009
  endif;
1010
 
1011
+ acf_reset_meta($options['field_key'] . '_' . $options['i']);
1012
+
1013
+ if(wp_doing_ajax()){
1014
+ die;
1015
+ }
1016
 
1017
  }
1018
 
1057
 
1058
  }
1059
 
1060
+ if(!class_exists('acfe_field_flexible_content')):
1061
+
1062
+ class acfe_field_flexible_content extends acf_field_flexible_content{
1063
+
1064
+ public $flexible = '';
1065
+ public $state = false;
1066
+ public $placeholder = false;
1067
+ public $preview = false;
1068
+ public $modal_edition = false;
1069
+ public $title_edition = false;
1070
+ public $copy_paste = false;
1071
+ public $remove_collapse = false;
1072
+ public $close_button = false;
1073
+ public $stylised_button = false;
1074
+ public $remove_actions = false;
1075
+
1076
+ function __construct(){
1077
+
1078
+ parent::initialize();
1079
+
1080
+ // Retrieve Flexible Content Class
1081
+ $this->flexible = acf_get_field_type('flexible_content');
1082
+
1083
+ // Remove Inherit Render Field
1084
+ remove_action('acf/render_field/type=flexible_content', array($this->flexible, 'render_field'), 9);
1085
+
1086
+ // Field Action
1087
+ $this->add_field_action('acf/render_field', array($this, 'render_field'), 9);
1088
+
1089
+ // General Filters
1090
+ $this->add_filter('acfe/flexible/layouts/icons', array($this, 'add_layout_icons'), 10, 3);
1091
+ $this->add_filter('acfe/flexible/layouts/div', array($this, 'add_layout_div'), 10, 3);
1092
+ $this->add_filter('acfe/flexible/layouts/handle', array($this, 'add_layout_handle'), 10, 3);
1093
+
1094
+ $this->add_filter('acf/load_fields', array($this, 'load_fields'), 10, 2);
1095
+
1096
+ // General Actions
1097
+ $this->add_action('wp_ajax_acfe/advanced_flexible_content/models', array($this, 'ajax_layout_model'));
1098
+ $this->add_action('wp_ajax_nopriv_acfe/advanced_flexible_content/models', array($this, 'ajax_layout_model'));
1099
+
1100
+ }
1101
 
1102
+ function load_fields($fields, $field){
1103
+
1104
+ if(!isset($field['type']) || $field['type'] !== 'flexible_content')
1105
+ return $fields;
1106
+
1107
+ if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group', 'acf_page_acf-tools')))
1108
+ return $fields;
1109
+
1110
+ if(!acf_maybe_get($field, 'layouts'))
1111
+ return $fields;
1112
+
1113
+ $settings = acf_maybe_get($field, 'acfe_flexible_layouts_settings');
1114
+ $title_edition = acf_maybe_get($field, 'acfe_flexible_title_edition');
1115
+
1116
+ // Settings OR Title Edition
1117
+ if(!$settings && !$title_edition)
1118
+ return $fields;
1119
+
1120
+ foreach($field['layouts'] as $layout_key => $layout){
1121
+
1122
+ // Settings
1123
+ if($settings_key = acf_maybe_get($layout, 'acfe_flexible_settings')){
1124
+
1125
+ $field_group = acf_get_field_group($settings_key);
1126
+
1127
+ if(!empty($field_group)){
1128
+
1129
+ $style = $field_group['label_placement'] === 'left' ? 'row' : 'block';
1130
+
1131
+ acf_add_local_field(array(
1132
+ 'label' => false,
1133
+ 'key' => 'field_acfe_' . $layout['key'] . '_settings',
1134
+ 'name' => 'layout_settings',
1135
+ 'type' => 'clone',
1136
+ 'clone' => array($settings_key),
1137
+ 'display' => 'group',
1138
+ 'acfe_seamless_style' => true,
1139
+ 'layout' => $style,
1140
+ 'prefix_label' => 0,
1141
+ 'prefix_name' => 1,
1142
+ 'parent_layout' => $layout['key'],
1143
+ 'parent' => $field['key']
1144
+ ));
1145
+
1146
+ $clone = acf_get_field('field_acfe_' . $layout['key'] . '_settings');
1147
+
1148
+ array_unshift($fields, $clone);
1149
+
1150
+ }
1151
+
1152
+ }
1153
+
1154
+ // Title Edition
1155
+ if($title_edition){
1156
+
1157
+ acf_add_local_field(array(
1158
+ 'label' => false,
1159
+ 'key' => 'field_acfe_' . $layout['key'] . '_title',
1160
+ 'name' => 'acfe_flexible_layout_title',
1161
+ 'type' => 'text',
1162
+ 'required' => false,
1163
+ 'maxlength' => false,
1164
+ 'default_value' => $layout['label'],
1165
+ 'placeholder' => $layout['label'],
1166
+ 'parent_layout' => $layout['key'],
1167
+ 'parent' => $field['key']
1168
+ ));
1169
+
1170
+ $title = acf_get_field('field_acfe_' . $layout['key'] . '_title');
1171
+
1172
+ array_unshift($fields, $title);
1173
+
1174
+ }
1175
+
1176
+ }
1177
+
1178
+ return $fields;
1179
+
1180
+ }
1181
 
1182
+ function ajax_layout_model(){
1183
+
1184
+ // options
1185
+ $options = acf_parse_args($_POST, array(
1186
+ 'field_key' => '',
1187
+ 'layout' => '',
1188
+ ));
1189
+
1190
+ $field = acf_get_field($options['field_key']);
1191
+ if(!$field)
1192
+ die;
1193
+
1194
+ $field = acf_prepare_field($field);
1195
+
1196
+ foreach($field['layouts'] as $k => $layout){
1197
+
1198
+ if($layout['name'] !== $options['layout'])
1199
+ continue;
1200
+
1201
+ $this->render_layout($field, $layout, 'acfcloneindex', array());
1202
+
1203
+ die;
1204
+
1205
+ }
1206
+
1207
+ die;
1208
+
1209
+ }
1210
 
1211
+ function render_field($field){
1212
+
1213
+ // settings
1214
+ $stylised_button = acf_maybe_get($field, 'acfe_flexible_stylised_button');
1215
+ $copy_paste = acf_maybe_get($field, 'acfe_flexible_copy_paste');
1216
+ $ajax = acf_maybe_get($field, 'acfe_flexible_layouts_ajax');
1217
+
1218
+ // Remove actions
1219
+ $remove_actions = false;
1220
+ $remove_actions = apply_filters('acfe/flexible/remove_actions', $remove_actions, $field);
1221
+ $remove_actions = apply_filters('acfe/flexible/remove_actions/name=' . $field['_name'], $remove_actions, $field);
1222
+ $remove_actions = apply_filters('acfe/flexible/remove_actions/key=' . $field['key'], $remove_actions, $field);
1223
+
1224
+ // defaults
1225
+ if(empty($field['button_label'])){
1226
+
1227
+ $field['button_label'] = $this->defaults['button_label'];
1228
+
1229
+ }
1230
+
1231
+ // sort layouts into names
1232
+ $layouts = array();
1233
+
1234
+ foreach($field['layouts'] as $k => $layout){
1235
+
1236
+ $layouts[$layout['name']] = $layout;
1237
+
1238
+ }
1239
+
1240
+ // vars
1241
+ $div = array(
1242
+ 'class' => 'acf-flexible-content',
1243
+ 'data-min' => $field['min'],
1244
+ 'data-max' => $field['max']
1245
+ );
1246
+
1247
+ // empty
1248
+ if(empty($field['value'])){
1249
+ $div['class'] .= ' -empty';
1250
+ }
1251
+
1252
+ // no value message
1253
+ $no_value_message = __('Click the "%s" button below to start creating your layout','acf');
1254
+ $no_value_message = apply_filters('acf/fields/flexible_content/no_value_message', $no_value_message, $field);
1255
+
1256
+ ?>
1257
+ <div <?php acf_esc_attr_e( $div ); ?>>
1258
+
1259
+ <?php acf_hidden_input(array('name' => $field['name'])); ?>
1260
+
1261
+ <div class="no-value-message">
1262
+ <?php printf($no_value_message, $field['button_label']); ?>
1263
+ </div>
1264
+
1265
+ <div class="clones">
1266
+ <?php foreach($layouts as $layout):
1267
+
1268
+ // Ajax
1269
+ if($ajax){
1270
+
1271
+ $div = array(
1272
+ 'class' => 'layout acf-clone',
1273
+ 'data-id' => 'acfcloneindex',
1274
+ 'data-layout' => $layout['name']
1275
+ );
1276
+
1277
+
1278
+ echo '<div ' . acf_esc_attr($div) . '></div>';
1279
+
1280
+ // No ajax
1281
+ }else{
1282
+
1283
+ $this->render_layout($field, $layout, 'acfcloneindex', array());
1284
+
1285
+ }
1286
+
1287
+ endforeach; ?>
1288
+ </div>
1289
+
1290
+ <div class="values">
1291
+ <?php if(!empty($field['value'])):
1292
+
1293
+ foreach($field['value'] as $i => $value):
1294
+
1295
+ // validate
1296
+ if(empty($layouts[$value['acf_fc_layout']]))
1297
+ continue;
1298
+
1299
+
1300
+ // render
1301
+ $this->render_layout($field, $layouts[ $value['acf_fc_layout'] ], $i, $value);
1302
+
1303
+ endforeach;
1304
+
1305
+ endif; ?>
1306
+ </div>
1307
+
1308
+ <?php if(!$remove_actions){
1309
+
1310
+ $button = array(
1311
+ 'class' => 'acf-button button',
1312
+ 'href' => '#',
1313
+ 'data-name' => 'add-layout',
1314
+ );
1315
+
1316
+ if(!$stylised_button){
1317
+
1318
+ $button['class'] .= ' button-primary';
1319
+
1320
+ }
1321
+
1322
+ if($stylised_button){ ?>
1323
+ <div class="acfe-flexible-stylised-button">
1324
+ <?php } ?>
1325
+
1326
+ <div class="acf-actions">
1327
+ <a <?php echo acf_esc_attr($button); ?>><?php echo $field['button_label']; ?></a>
1328
+
1329
+ <?php
1330
+
1331
+ $secondary_actions = array();
1332
+
1333
+ if($copy_paste){
1334
+
1335
+ $secondary_actions['copy'] = '<a href="#" data-acfe-flexible-control-action="copy">' . __('Copy layouts', 'acfe') . '</a>';
1336
+ $secondary_actions['paste'] = '<a href="#" data-acfe-flexible-control-action="paste">' . __('Paste layouts', 'acfe') . '</a>';
1337
+
1338
+ }
1339
+
1340
+ $secondary_actions = apply_filters('acfe/flexible/secondary_actions', $secondary_actions, $field);
1341
+ $secondary_actions = apply_filters('acfe/flexible/secondary_actions/name=' . $field['_name'], $secondary_actions, $field);
1342
+ $secondary_actions = apply_filters('acfe/flexible/secondary_actions/key=' . $field['key'], $secondary_actions, $field);
1343
+
1344
+ ?>
1345
+
1346
+ <?php if(!empty($secondary_actions)){ ?>
1347
+
1348
+ <?php
1349
+
1350
+ $button_secondary = array(
1351
+ 'class' => 'button',
1352
+ 'style' => 'padding-left:5px;padding-right:5px; margin-left:3px;',
1353
+ 'href' => '#',
1354
+ 'data-name' => 'acfe-flexible-control-button',
1355
+ );
1356
+
1357
+ if(!$stylised_button){
1358
+
1359
+ $button_secondary['class'] .= ' button-primary';
1360
+
1361
+ }
1362
+ ?>
1363
+
1364
+ <a <?php echo acf_esc_attr($button_secondary); ?>>
1365
+ <span class="dashicons dashicons-arrow-down-alt2" style="vertical-align:text-top;width:auto;height:auto;font-size:13px;line-height:20px;"></span>
1366
+ </a>
1367
+
1368
+ <script type="text-html" class="tmpl-acfe-flexible-control-popup">
1369
+ <ul>
1370
+ <?php foreach($secondary_actions as $secondary_action){ ?>
1371
+ <li><?php echo $secondary_action; ?></li>
1372
+ <?php } ?>
1373
+ </ul>
1374
+ </script>
1375
+
1376
+ <?php } ?>
1377
+
1378
+ </div>
1379
+
1380
+ <?php if($stylised_button){ ?>
1381
+ </div>
1382
+ <?php } ?>
1383
+
1384
+ <script type="text-html" class="tmpl-popup">
1385
+ <ul>
1386
+ <?php foreach( $layouts as $layout ):
1387
+
1388
+ $atts = array(
1389
+ 'href' => '#',
1390
+ 'data-layout' => $layout['name'],
1391
+ 'data-min' => $layout['min'],
1392
+ 'data-max' => $layout['max'],
1393
+ );
1394
+
1395
+ ?><li><a <?php acf_esc_attr_e($atts); ?>><?php echo $layout['label']; ?></a></li><?php
1396
+
1397
+ endforeach; ?>
1398
+ </ul>
1399
+ </script>
1400
+
1401
+ <?php } ?>
1402
+
1403
+ </div>
1404
+ <?php
1405
+
1406
+ }
1407
+
1408
+ function render_layout($field, $layout, $i, $value){
1409
+
1410
+ // settings
1411
+ $this->state = acf_maybe_get($field, 'acfe_flexible_layouts_state');
1412
+ $this->placeholder = acf_maybe_get($field, 'acfe_flexible_layouts_placeholder');
1413
+ $this->preview = acf_maybe_get($field, 'acfe_flexible_layouts_previews');
1414
+ $this->modal_edition = acf_maybe_get($field, 'acfe_flexible_modal_edition');
1415
+ $this->title_edition = acf_maybe_get($field, 'acfe_flexible_title_edition');
1416
+ $this->copy_paste = acf_maybe_get($field, 'acfe_flexible_copy_paste');
1417
+ $this->remove_collapse = acf_maybe_get($field, 'acfe_flexible_layouts_remove_collapse');
1418
+ $this->close_button = acf_maybe_get($field, 'acfe_flexible_close_button');
1419
+ $this->stylised_button = acf_maybe_get($field, 'acfe_flexible_stylised_button');
1420
+ $this->settings = acf_maybe_get($layout, 'acfe_flexible_settings');
1421
+
1422
+ // Remove actions
1423
+ $this->remove_actions = apply_filters('acfe/flexible/remove_actions', $this->remove_actions, $field);
1424
+ $this->remove_actions = apply_filters('acfe/flexible/remove_actions/name=' . $field['_name'], $this->remove_actions, $field);
1425
+ $this->remove_actions = apply_filters('acfe/flexible/remove_actions/key=' . $field['key'], $this->remove_actions, $field);
1426
+
1427
+ // vars
1428
+ $sub_fields = $layout['sub_fields'];
1429
+ $id = ($i === 'acfcloneindex') ? 'acfcloneindex' : "row-$i";
1430
+ $prefix = $field['name'] . '[' . $id . ']';
1431
+
1432
+ // div
1433
+ $div = array(
1434
+ 'class' => 'layout',
1435
+ 'data-id' => $id,
1436
+ 'data-layout' => $layout['name']
1437
+ );
1438
+
1439
+ // clone
1440
+ if(!is_numeric($i)){
1441
+
1442
+ $div['class'] .= ' acf-clone';
1443
+
1444
+ }
1445
+
1446
+ // div
1447
+ $div = $this->get_layout_div($div, $layout, $field);
1448
+
1449
+ // handle
1450
+ $handle = $this->get_layout_handle($layout, $field);
1451
+
1452
+ // title
1453
+ $title = $this->get_layout_title($field, $layout, $i, $value);
1454
+
1455
+ // remove row
1456
+ reset_rows();
1457
+
1458
+ ?>
1459
+ <div <?php echo acf_esc_attr($div); ?>>
1460
+
1461
+ <?php acf_hidden_input(array( 'name' => $prefix.'[acf_fc_layout]', 'value' => $layout['name'] )); ?>
1462
+
1463
+ <div <?php echo acf_esc_attr($handle); ?>><?php echo $title; ?></div>
1464
+
1465
+ <?php
1466
+
1467
+ // Title Edition
1468
+ $this->render_layout_title_edition($sub_fields, $value, $prefix);
1469
+
1470
+ // Icons
1471
+ $this->render_layout_icons($layout, $field);
1472
+
1473
+ // Placeholder
1474
+ $this->render_layout_placeholder($value, $layout, $field, $i);
1475
+
1476
+
1477
+ add_filter('acf/prepare_field/type=wysiwyg', array($this, 'acfe_flexible_editor_delay'));
1478
+
1479
+ // Fields
1480
+ $this->render_layout_fields($layout, $sub_fields, $value, $prefix);
1481
+
1482
+ remove_filter('acf/prepare_field/type=wysiwyg', array($this, 'acfe_flexible_editor_delay'));
1483
+
1484
+ ?>
1485
+
1486
+ </div>
1487
+ <?php
1488
+
1489
+ }
1490
+
1491
+ function get_layout_div($div, $layout, $field){
1492
+
1493
+ $div = apply_filters('acfe/flexible/layouts/div', $div, $layout, $field);
1494
+ $div = apply_filters('acfe/flexible/layouts/div/name=' . $field['_name'], $div, $layout, $field);
1495
+ $div = apply_filters('acfe/flexible/layouts/div/key=' . $field['key'], $div, $layout, $field);
1496
+ $div = apply_filters('acfe/flexible/layouts/div/name=' . $field['_name'] . '&layout=' . $layout['name'], $div, $layout, $field);
1497
+ $div = apply_filters('acfe/flexible/layouts/div/key=' . $field['key'] . '&layout=' . $layout['name'], $div, $layout, $field);
1498
+
1499
+ return $div;
1500
+
1501
+ }
1502
+
1503
+ function get_layout_handle($layout, $field){
1504
+
1505
+ $handle = array(
1506
+ 'class' => 'acf-fc-layout-handle',
1507
+ 'title' => __('Drag to reorder','acf'),
1508
+ 'data-name' => 'collapse-layout',
1509
+ );
1510
+
1511
+ if($this->remove_collapse){
1512
+
1513
+ unset($handle['data-name']);
1514
+
1515
+ }
1516
+
1517
+ $handle = apply_filters('acfe/flexible/layouts/handle', $handle, $layout, $field);
1518
+ $handle = apply_filters('acfe/flexible/layouts/handle/name=' . $field['_name'], $handle, $layout, $field);
1519
+ $handle = apply_filters('acfe/flexible/layouts/handle/key=' . $field['key'], $handle, $layout, $field);
1520
+ $handle = apply_filters('acfe/flexible/layouts/handle/name=' . $field['_name'] . '&layout=' . $layout['name'], $handle, $layout, $field);
1521
+ $handle = apply_filters('acfe/flexible/layouts/handle/key=' . $field['key'] . '&layout=' . $layout['name'], $handle, $layout, $field);
1522
+
1523
+ return $handle;
1524
+
1525
+ }
1526
+
1527
+ function render_layout_icons($layout, $field){
1528
+
1529
+ // icons
1530
+ $icons = array(
1531
+ 'add' => '<a class="acf-icon -plus small light acf-js-tooltip" href="#" data-name="add-layout" title="' . __('Add layout','acf') . '"></a>',
1532
+ 'remove' => '<a class="acf-icon -minus small light acf-js-tooltip" href="#" data-name="remove-layout" title="' . __('Remove layout','acf') . '"></a>',
1533
+ 'collapse' => '<a class="acf-icon -collapse small acf-js-tooltip" href="#" data-name="collapse-layout" title="' . __('Click to toggle','acf') . '"></a>'
1534
+ );
1535
+
1536
+ $icons = apply_filters('acfe/flexible/layouts/icons', $icons, $layout, $field);
1537
+ $icons = apply_filters('acfe/flexible/layouts/icons/name=' . $field['_name'], $icons, $layout, $field);
1538
+ $icons = apply_filters('acfe/flexible/layouts/icons/key=' . $field['key'], $icons, $layout, $field);
1539
+ $icons = apply_filters('acfe/flexible/layouts/icons/name=' . $field['_name'] . '&layout=' . $layout['name'], $icons, $layout, $field);
1540
+ $icons = apply_filters('acfe/flexible/layouts/icons/key=' . $field['key'] . '&layout=' . $layout['name'], $icons, $layout, $field);
1541
+
1542
+ if(!empty($icons)){ ?>
1543
+
1544
+ <div class="acf-fc-layout-controls">
1545
+
1546
+ <?php foreach($icons as $icon){ ?>
1547
+
1548
+ <?php echo $icon; ?>
1549
+
1550
+ <?php } ?>
1551
+
1552
+ </div>
1553
+
1554
+ <?php }
1555
+
1556
+ }
1557
+
1558
+ function render_layout_title_edition(&$sub_fields, $value, $prefix){
1559
+
1560
+ if(!$this->title_edition || empty($sub_fields))
1561
+ return false;
1562
+
1563
+ if($sub_fields[0]['name'] !== 'acfe_flexible_layout_title')
1564
+ return false;
1565
+
1566
+ // Extract
1567
+ $title = acf_extract_var($sub_fields, 0);
1568
+
1569
+ // Reset key 0
1570
+ $sub_fields = array_values($sub_fields);
1571
+
1572
+ // add value
1573
+ if( isset($value[ $title['key'] ]) ) {
1574
+
1575
+ // this is a normal value
1576
+ $title['value'] = $value[ $title['key'] ];
1577
+
1578
+ } elseif( isset($title['default_value']) ) {
1579
+
1580
+ // no value, but this sub field has a default value
1581
+ $title['value'] = $title['default_value'];
1582
+
1583
+ }
1584
+
1585
+ // update prefix to allow for nested values
1586
+ $title['prefix'] = $prefix;
1587
+
1588
+ $title['class'] = 'acfe-flexible-control-title';
1589
+ $title['data-acfe-flexible-control-title-input'] = 1;
1590
+
1591
+ $title = acf_validate_field($title);
1592
+ $title = acf_prepare_field($title);
1593
+
1594
+ $input_attrs = array();
1595
+ foreach( array( 'type', 'id', 'class', 'name', 'value', 'placeholder', 'maxlength', 'pattern', 'readonly', 'disabled', 'required', 'data-acfe-flexible-control-title-input' ) as $k ) {
1596
+ if( isset($title[ $k ]) ) {
1597
+ $input_attrs[ $k ] = $title[ $k ];
1598
+ }
1599
+ }
1600
+
1601
+ // render input
1602
+ echo acf_get_text_input(acf_filter_attrs($input_attrs));
1603
+
1604
+ }
1605
+
1606
+ function render_layout_placeholder($value, $layout, $field, $i){
1607
+
1608
+ if(!$this->placeholder && !$this->preview)
1609
+ return false;
1610
+
1611
+ $placeholder = array(
1612
+ 'class' => 'acfe-fc-placeholder',
1613
+ 'title' => __('Edit layout', 'acfe'),
1614
+ );
1615
+
1616
+ if(!$this->modal_edition && !$this->preview && $this->state !== 'collapse'){
1617
+
1618
+ $placeholder['class'] .= ' acf-hidden';
1619
+
1620
+ }
1621
+
1622
+ $preview_html = false;
1623
+
1624
+ if($this->preview){
1625
+
1626
+ if(!empty($value)){
1627
+
1628
+ ob_start();
1629
+
1630
+ acfe_flexible_layout_preview(array(
1631
+ 'post_id' => acf_get_valid_post_id(),
1632
+ 'i' => $i,
1633
+ 'field_key' => $field['key'],
1634
+ 'layout' => $layout['name'],
1635
+ 'value' => $value,
1636
+ ));
1637
+
1638
+ $preview_html = ob_get_clean();
1639
+
1640
+ if(strlen($preview_html) > 0){
1641
+
1642
+ $placeholder['class'] .= ' acfe-fc-preview';
1643
+
1644
+ }
1645
+
1646
+ }
1647
+
1648
+ }
1649
+
1650
+ if($this->modal_edition){
1651
+
1652
+ $placeholder['data-action'] = 'acfe-flexible-modal-edit';
1653
+
1654
+ }
1655
+
1656
+ ?>
1657
+
1658
+ <div <?php echo acf_esc_attr($placeholder); ?>>
1659
+
1660
+ <a href="#" class="button">
1661
+ <span class="dashicons dashicons-edit"></span>
1662
+ </a>
1663
+
1664
+ <div class="acfe-fc-overlay"></div>
1665
+
1666
+ <div class="acfe-flexible-placeholder -preview">
1667
+ <?php echo $preview_html; ?>
1668
+ </div>
1669
+
1670
+ </div>
1671
+
1672
+ <?php
1673
+
1674
+ }
1675
 
1676
+ function render_layout_fields($layout, $sub_fields, $value, $prefix){
1677
+
1678
+ $modal_edition = $this->modal_edition;
1679
+ $close_button = $this->close_button;
1680
+
1681
+ if(empty($sub_fields))
1682
+ return;
1683
+
1684
+ if($sub_fields[0]['name'] === 'layout_settings'){
1685
+
1686
+ $sub_field = acf_extract_var($sub_fields, 0);
1687
+ ?>
1688
+
1689
+ <div class="acfe-modal -settings">
1690
+ <div class="acfe-modal-wrapper">
1691
+ <div class="acfe-modal-content">
1692
+
1693
+ <div class="acf-fields -top">
1694
+
1695
+ <?php
1696
+
1697
+ // add value
1698
+ if( isset($value[ $sub_field['key'] ]) ) {
1699
+
1700
+ // this is a normal value
1701
+ $sub_field['value'] = $value[ $sub_field['key'] ];
1702
+
1703
+ } elseif( isset($sub_field['default_value']) ) {
1704
+
1705
+ // no value, but this sub field has a default value
1706
+ $sub_field['value'] = $sub_field['default_value'];
1707
+
1708
+ }
1709
+
1710
+
1711
+ // update prefix to allow for nested values
1712
+ $sub_field['prefix'] = $prefix;
1713
+
1714
+
1715
+ // render input
1716
+ acf_render_field_wrap($sub_field, 'div');
1717
+
1718
+ ?>
1719
+
1720
+ </div>
1721
+
1722
+ </div>
1723
+ </div>
1724
+ </div>
1725
+
1726
+ <?php
1727
+
1728
+ }
1729
+
1730
+ // el
1731
+ $el = 'div';
1732
+
1733
+ if($layout['display'] == 'table'){
1734
+
1735
+ $el = 'td';
1736
+
1737
+ }
1738
+
1739
+ if($modal_edition){ ?>
1740
+
1741
+ <div class="acfe-modal -fields">
1742
+ <div class="acfe-modal-wrapper">
1743
+ <div class="acfe-modal-content">
1744
+
1745
+ <?php } ?>
1746
+
1747
+ <?php if( $layout['display'] == 'table' ): ?>
1748
+ <table class="acf-table">
1749
+
1750
+ <thead>
1751
+ <tr>
1752
+ <?php foreach( $sub_fields as $sub_field ):
1753
+
1754
+ // prepare field (allow sub fields to be removed)
1755
+ $sub_field = acf_prepare_field($sub_field);
1756
+
1757
+
1758
+ // bail ealry if no field
1759
+ if( !$sub_field ) continue;
1760
+
1761
+
1762
+ // vars
1763
+ $atts = array();
1764
+ $atts['class'] = 'acf-th';
1765
+ $atts['data-name'] = $sub_field['_name'];
1766
+ $atts['data-type'] = $sub_field['type'];
1767
+ $atts['data-key'] = $sub_field['key'];
1768
+
1769
+
1770
+ // Add custom width
1771
+ if( $sub_field['wrapper']['width'] ) {
1772
+
1773
+ $atts['data-width'] = $sub_field['wrapper']['width'];
1774
+ $atts['style'] = 'width: ' . $sub_field['wrapper']['width'] . '%;';
1775
+
1776
+ }
1777
+
1778
+ ?>
1779
+ <th <?php echo acf_esc_attr( $atts ); ?>>
1780
+ <?php echo acf_get_field_label( $sub_field ); ?>
1781
+ <?php if( $sub_field['instructions'] ): ?>
1782
+ <p class="description"><?php echo $sub_field['instructions']; ?></p>
1783
+ <?php endif; ?>
1784
+ </th>
1785
+
1786
+ <?php endforeach; ?>
1787
+ </tr>
1788
+ </thead>
1789
+
1790
+ <tbody>
1791
+ <tr class="acf-row">
1792
+ <?php else: ?>
1793
+ <div class="acf-fields <?php if($layout['display'] == 'row'): ?>-left<?php endif; ?>">
1794
+ <?php endif; ?>
1795
+
1796
+ <?php
1797
+
1798
+ // loop though sub fields
1799
+ foreach( $sub_fields as $sub_field ) {
1800
+
1801
+ // add value
1802
+ if( isset($value[ $sub_field['key'] ]) ) {
1803
+
1804
+ // this is a normal value
1805
+ $sub_field['value'] = $value[ $sub_field['key'] ];
1806
+
1807
+ } elseif( isset($sub_field['default_value']) ) {
1808
+
1809
+ // no value, but this sub field has a default value
1810
+ $sub_field['value'] = $sub_field['default_value'];
1811
+
1812
+ }
1813
+
1814
+
1815
+ // update prefix to allow for nested values
1816
+ $sub_field['prefix'] = $prefix;
1817
+
1818
+
1819
+ // render input
1820
+ acf_render_field_wrap( $sub_field, $el );
1821
+
1822
+ }
1823
+
1824
+ ?>
1825
+
1826
+ <?php if(!$modal_edition && $close_button){ ?>
1827
+
1828
+ <div class="acfe-flexible-opened-actions"><a href="javascript:void(0);" class="button"><?php _e('Close', 'acf'); ?></button></a></div>
1829
+
1830
+ <?php } ?>
1831
+
1832
+ <?php if( $layout['display'] == 'table' ): ?>
1833
+ </tr>
1834
+ </tbody>
1835
+ </table>
1836
+ <?php else: ?>
1837
+ </div>
1838
+ <?php endif; ?>
1839
+
1840
+ <?php if($modal_edition){ ?>
1841
+
1842
+ </div>
1843
+ </div>
1844
+ </div>
1845
+
1846
+ <?php }
1847
+
1848
+ }
1849
+
1850
+ function acfe_flexible_editor_delay($field){
1851
+
1852
+ $field['delay'] = 1;
1853
+
1854
  return $field;
1855
+
1856
+ }
1857
 
1858
+ function add_layout_icons($icons, $layout, $field){
1859
+
1860
+ // Settings
1861
+ if($this->settings){
1862
+
1863
+ $new_icons = array(
1864
+ 'settings' => '<a class="acf-icon small light acf-js-tooltip acfe-flexible-icon dashicons dashicons-admin-generic" href="#" title="Settings" data-acfe-flexible-settings="' . $layout['name'] . '"></a>'
1865
+ );
1866
+
1867
+ $icons = array_merge($icons, $new_icons);
1868
+
1869
+ }
1870
+
1871
+ // Copy/Paste
1872
+ if($this->copy_paste){
1873
+
1874
+ $new_icons = array(
1875
+ 'copy' => '<a class="acf-icon small light acf-js-tooltip acfe-flexible-icon dashicons dashicons-category" href="#" title="Copy layout" data-acfe-flexible-control-copy="' . $layout['name'] . '"></a>'
1876
+ );
1877
+
1878
+ $icons = array_merge($new_icons, $icons);
1879
+
1880
+ }
1881
+
1882
+ // Clone
1883
+ $new_icons = array(
1884
+ 'clone' => '<a class="acf-icon small light acf-js-tooltip acfe-flexible-icon dashicons dashicons-admin-page" href="#" title="Clone layout" data-acfe-flexible-control-clone="' . $layout['name'] . '"></a>'
1885
+ );
1886
+
1887
+ $icons = array_merge($new_icons, $icons);
1888
+
1889
+ // Remove Toggle
1890
+ if(($this->modal_edition || $this->remove_collapse) && isset($icons['collapse'])){
1891
+
1892
+ unset($icons['collapse']);
1893
+
1894
+ }
1895
+
1896
+ if($this->remove_actions){
1897
+
1898
+ // Add
1899
+ if(isset($icons['add'])) unset($icons['add']);
1900
+
1901
+ // Remove
1902
+ if(isset($icons['remove'])) unset($icons['remove']);
1903
+
1904
+ // Clone
1905
+ if(isset($icons['clone'])) unset($icons['clone']);
1906
+
1907
+ // Copy/Paste
1908
+ if(isset($icons['copy'])) unset($icons['copy']);
1909
+
1910
+ }
1911
+
1912
+ return $icons;
1913
 
1914
  }
1915
 
1916
+ function add_layout_div($div, $layout, $field){
1917
+
1918
+ // Class
1919
+ if($this->state === 'collapse' || $this->preview || $this->modal_edition){
1920
+
1921
+ $div['class'] .= ' -collapsed';
1922
+
1923
+ }
1924
+
1925
+ return $div;
1926
+
1927
+ }
1928
+
1929
+ function add_layout_handle($handle, $layout, $field){
1930
+
1931
+ // Data
1932
+ if($this->modal_edition){
1933
+
1934
+ $handle['data-action'] = 'acfe-flexible-modal-edit';
1935
+
1936
+ }
1937
+
1938
+ return $handle;
1939
+
1940
+ }
1941
 
1942
+ }
1943
+
1944
+ acf_register_field_type('acfe_field_flexible_content');
1945
+
1946
+ endif;
includes/fields/field-group.php CHANGED
@@ -7,9 +7,9 @@ add_action('acf/render_field_settings/type=group', 'acfe_field_group_settings');
7
  function acfe_field_group_settings($field){
8
 
9
  acf_render_field_setting($field, array(
10
- 'label' => __('Seemless Style'),
11
- 'name' => 'acfe_seemless_style',
12
- 'key' => 'acfe_seemless_style',
13
  'instructions' => __('Enable better CSS integration: remove borders and padding'),
14
  'type' => 'true_false',
15
  'message' => '',
@@ -94,9 +94,9 @@ function acfe_field_group_wrapper($wrapper, $field){
94
  add_filter('acf/prepare_field/type=group', 'acfe_field_group_type_class', 99);
95
  function acfe_field_group_type_class($field){
96
 
97
- if(acf_maybe_get($field, 'acfe_seemless_style')){
98
 
99
- $field['wrapper']['class'] .= ' acfe-seemless-style';
100
 
101
  }
102
 
7
  function acfe_field_group_settings($field){
8
 
9
  acf_render_field_setting($field, array(
10
+ 'label' => __('Seamless Style', 'acfe'),
11
+ 'name' => 'acfe_seamless_style',
12
+ 'key' => 'acfe_seamless_style',
13
  'instructions' => __('Enable better CSS integration: remove borders and padding'),
14
  'type' => 'true_false',
15
  'message' => '',
94
  add_filter('acf/prepare_field/type=group', 'acfe_field_group_type_class', 99);
95
  function acfe_field_group_type_class($field){
96
 
97
+ if(acf_maybe_get($field, 'acfe_seamless_style')){
98
 
99
+ $field['wrapper']['class'] .= ' acfe-seamless-style';
100
 
101
  }
102
 
includes/locations/post-type-archive.php CHANGED
@@ -7,9 +7,13 @@ if(!class_exists('acfe_location_post_type_archive')):
7
 
8
  class acfe_location_post_type_archive{
9
 
 
 
 
10
  function __construct(){
11
 
12
  add_action('init', array($this, 'init'), 99);
 
13
 
14
  add_filter('acf/get_options_pages', array($this, 'get_options_pages'));
15
 
@@ -48,10 +52,52 @@ class acfe_location_post_type_archive{
48
  'acfe_post_type_archive' => true
49
  ));
50
 
 
 
51
  }
52
 
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  function get_options_pages($pages){
56
 
57
  $check_current_screen = acf_is_screen(array(
7
 
8
  class acfe_location_post_type_archive{
9
 
10
+ public $post_type = '';
11
+ public $post_types = array();
12
+
13
  function __construct(){
14
 
15
  add_action('init', array($this, 'init'), 99);
16
+ add_action('current_screen', array($this, 'current_screen'));
17
 
18
  add_filter('acf/get_options_pages', array($this, 'get_options_pages'));
19
 
52
  'acfe_post_type_archive' => true
53
  ));
54
 
55
+ $this->post_types[] = $name;
56
+
57
  }
58
 
59
  }
60
 
61
+ function current_screen($screen){
62
+
63
+ foreach($this->post_types as $post_type){
64
+
65
+ if(!acf_is_screen("{$post_type}_page_{$post_type}-archive"))
66
+ continue;
67
+
68
+ $post_type_obj = get_post_type_object($post_type);
69
+
70
+ if(!isset($post_type_obj->has_archive) || empty($post_type_obj->has_archive))
71
+ break;
72
+
73
+ $this->post_type = $post_type;
74
+
75
+ add_action('admin_footer', array($this, 'admin_footer'));
76
+
77
+ break;
78
+
79
+ }
80
+
81
+ }
82
+
83
+ function admin_footer(){
84
+ ?>
85
+ <div id="tmpl-acf-after-title">
86
+ <div style="margin-top:7px;">
87
+ <strong><?php _e('Permalink:'); ?></strong> <span><a href="<?php echo get_post_type_archive_link($this->post_type); ?>" target="_blank"><?php echo get_post_type_archive_link($this->post_type); ?></a></span>
88
+ </div>
89
+ </div>
90
+ <script type="text/javascript">
91
+ (function($){
92
+
93
+ // add after title
94
+ $('.acf-settings-wrap > h1').after($('#tmpl-acf-after-title'));
95
+
96
+ })(jQuery);
97
+ </script>
98
+ <?php
99
+ }
100
+
101
  function get_options_pages($pages){
102
 
103
  $check_current_screen = acf_is_screen(array(
includes/modules/autosync.php CHANGED
@@ -91,6 +91,7 @@ function acfe_autosync_temp_disable_json(){
91
  * Auto Sync: PHP
92
  */
93
  add_action('acf/update_field_group', 'acfe_autosync_php_update_field_group');
 
94
  function acfe_autosync_php_update_field_group($field_group){
95
 
96
  // Validate
@@ -105,6 +106,25 @@ function acfe_autosync_php_update_field_group($field_group){
105
 
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  /**
109
  * Auto Sync: Write PHP
110
  */
@@ -181,6 +201,27 @@ function acfe_autosync_write_php($field_group){
181
 
182
  }
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  /**
185
  * Auto Sync: Helper - is field group json desync
186
  */
91
  * Auto Sync: PHP
92
  */
93
  add_action('acf/update_field_group', 'acfe_autosync_php_update_field_group');
94
+ add_action('acf/untrash_field_group', 'acfe_autosync_php_update_field_group');
95
  function acfe_autosync_php_update_field_group($field_group){
96
 
97
  // Validate
106
 
107
  }
108
 
109
+ add_action('acf/trash_field_group', 'acfe_autosync_php_delete_field_group');
110
+ add_action('acf/delete_field_group', 'acfe_autosync_php_delete_field_group');
111
+ function acfe_autosync_php_delete_field_group($field_group){
112
+
113
+ // validate
114
+ if(!acf_get_setting('acfe/php'))
115
+ return;
116
+
117
+ if(!acfe_has_field_group_autosync($field_group, 'php'))
118
+ return;
119
+
120
+ // WP appends '__trashed' to end of 'key' (post_name)
121
+ $field_group['key'] = str_replace('__trashed', '', $field_group['key']);
122
+
123
+ // delete
124
+ acfe_autosync_delete_php($field_group['key']);
125
+
126
+ }
127
+
128
  /**
129
  * Auto Sync: Write PHP
130
  */
201
 
202
  }
203
 
204
+ function acfe_autosync_delete_php($key){
205
+
206
+ // vars
207
+ $path = acf_get_setting('acfe/php_save');
208
+ $file = $key . '.php';
209
+
210
+ // remove trailing slash
211
+ $path = untrailingslashit($path);
212
+
213
+ // bail early if file does not exist
214
+ if(!is_readable("{$path}/{$file}"))
215
+ return false;
216
+
217
+ // remove file
218
+ unlink("{$path}/{$file}");
219
+
220
+ // return
221
+ return true;
222
+
223
+ }
224
+
225
  /**
226
  * Auto Sync: Helper - is field group json desync
227
  */
includes/modules/dev.php CHANGED
@@ -25,11 +25,17 @@ class acfe_dev{
25
  if(acf_get_setting('acfe/super_dev', false) || (defined('ACFE_super_dev') && ACFE_super_dev))
26
  $this->is_super_dev = true;
27
 
 
28
  add_action('load-post.php', array($this, 'load_post'));
29
  add_action('load-post-new.php', array($this, 'load_post'));
30
 
 
31
  add_action('load-term.php', array($this, 'load_term'));
32
 
 
 
 
 
33
  }
34
 
35
  function load_post(){
@@ -89,6 +95,42 @@ class acfe_dev{
89
 
90
  echo '</div>';
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
  function get_meta($post_id = 0){
@@ -118,6 +160,13 @@ class acfe_dev{
118
 
119
  }
120
 
 
 
 
 
 
 
 
121
  usort($get_meta, function($a, $b){
122
  return strcmp($a->meta_key, $b->meta_key);
123
  });
25
  if(acf_get_setting('acfe/super_dev', false) || (defined('ACFE_super_dev') && ACFE_super_dev))
26
  $this->is_super_dev = true;
27
 
28
+ // Post
29
  add_action('load-post.php', array($this, 'load_post'));
30
  add_action('load-post-new.php', array($this, 'load_post'));
31
 
32
+ // Term
33
  add_action('load-term.php', array($this, 'load_term'));
34
 
35
+ // User
36
+ add_action('show_user_profile', array($this, 'load_user'));
37
+ add_action('edit_user_profile', array($this, 'load_user'));
38
+
39
  }
40
 
41
  function load_post(){
95
 
96
  echo '</div>';
97
 
98
+ }
99
+
100
+ function load_user(){
101
+
102
+ global $user_id;
103
+ $user_id = (int) $user_id;
104
+
105
+ if(empty($user_id))
106
+ return;
107
+
108
+ $this->get_meta('user_' . $user_id);
109
+
110
+ if(!empty($this->wp_meta)){
111
+
112
+ add_meta_box('acfe-wp-custom-fields', 'WP Custom fields', array($this, 'wp_render_meta_box'), 'edit-user', 'normal', 'low');
113
+
114
+ }
115
+
116
+ if(!empty($this->acf_meta)){
117
+
118
+ add_meta_box('acfe-acf-custom-fields', 'ACF Custom fields', array($this, 'acf_render_meta_box'), 'edit-user', 'normal', 'low');
119
+
120
+ }
121
+
122
+ echo '<div id="poststuff">';
123
+
124
+ do_meta_boxes('edit-user', 'normal', array());
125
+
126
+ echo '</div>';
127
+
128
+ }
129
+
130
+ function user_footer(){
131
+
132
+
133
+
134
  }
135
 
136
  function get_meta($post_id = 0){
160
 
161
  }
162
 
163
+ // User
164
+ elseif($info['type'] === 'user'){
165
+
166
+ $get_meta = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d ", $info['id']));
167
+
168
+ }
169
+
170
  usort($get_meta, function($a, $b){
171
  return strcmp($a->meta_key, $b->meta_key);
172
  });
includes/modules/dynamic-post-type.php CHANGED
@@ -573,7 +573,8 @@ function acfe_dpt_admin_columns_html($column, $post_id){
573
 
574
  // Count
575
  $count = wp_count_posts($name);
576
- if(empty($count)){
 
577
 
578
  echo '—';
579
  return;
573
 
574
  // Count
575
  $count = wp_count_posts($name);
576
+
577
+ if(empty($count) || !isset($count->publish)){
578
 
579
  echo '—';
580
  return;
includes/modules/dynamic-taxonomy.php CHANGED
@@ -531,6 +531,13 @@ function acfe_dt_admin_columns_html($column, $post_id){
531
  'hide_empty' => false
532
  ));
533
 
 
 
 
 
 
 
 
534
  echo '<a href="' . admin_url('edit-tags.php?taxonomy=' . $name) . '">' . $count . '</a>';
535
 
536
  }
531
  'hide_empty' => false
532
  ));
533
 
534
+ if(is_wp_error($count)){
535
+
536
+ echo '—';
537
+ return;
538
+
539
+ }
540
+
541
  echo '<a href="' . admin_url('edit-tags.php?taxonomy=' . $name) . '">' . $count . '</a>';
542
 
543
  }
includes/modules/form/field-group.php CHANGED
@@ -104,7 +104,7 @@ acf_add_local_field_group(array(
104
  ),
105
  'acfe_permissions' => '',
106
  'layout' => 'block',
107
- 'acfe_seemless_style' => true,
108
  'acfe_group_modal' => 0,
109
  'conditional_logic' => array(
110
  array(
@@ -217,7 +217,7 @@ acf_add_local_field_group(array(
217
  ),
218
  'acfe_permissions' => '',
219
  'layout' => 'block',
220
- 'acfe_seemless_style' => true,
221
  'acfe_group_modal' => 0,
222
  'conditional_logic' => array(),
223
  'sub_fields' => array(
@@ -1260,7 +1260,7 @@ acf_add_local_field_group(array(
1260
  ),
1261
  'acfe_permissions' => '',
1262
  'layout' => 'block',
1263
- 'acfe_seemless_style' => true,
1264
  'acfe_group_modal' => 0,
1265
  'sub_fields' => array(
1266
  array(
@@ -1364,7 +1364,7 @@ acf_add_local_field_group(array(
1364
  ),
1365
  'acfe_permissions' => '',
1366
  'layout' => 'block',
1367
- 'acfe_seemless_style' => true,
1368
  'acfe_group_modal' => 0,
1369
  'sub_fields' => array(
1370
  array(
@@ -1468,7 +1468,7 @@ acf_add_local_field_group(array(
1468
  ),
1469
  'acfe_permissions' => '',
1470
  'layout' => 'block',
1471
- 'acfe_seemless_style' => true,
1472
  'acfe_group_modal' => 0,
1473
  'sub_fields' => array(
1474
  array(
@@ -2256,7 +2256,7 @@ acf_add_local_field_group(array(
2256
  ),
2257
  'acfe_permissions' => '',
2258
  'layout' => 'block',
2259
- 'acfe_seemless_style' => true,
2260
  'acfe_group_modal' => 0,
2261
  'sub_fields' => array(
2262
  array(
@@ -2359,7 +2359,7 @@ acf_add_local_field_group(array(
2359
  ),
2360
  'acfe_permissions' => '',
2361
  'layout' => 'block',
2362
- 'acfe_seemless_style' => true,
2363
  'acfe_group_modal' => 0,
2364
  'sub_fields' => array(
2365
  array(
@@ -2574,7 +2574,7 @@ acf_add_local_field_group(array(
2574
  ),
2575
  'acfe_permissions' => '',
2576
  'layout' => 'block',
2577
- 'acfe_seemless_style' => true,
2578
  'acfe_group_modal' => 0,
2579
  'sub_fields' => array(
2580
  array(
@@ -3121,7 +3121,7 @@ acf_add_local_field_group(array(
3121
  ),
3122
  'acfe_permissions' => '',
3123
  'layout' => 'block',
3124
- 'acfe_seemless_style' => true,
3125
  'acfe_group_modal' => 0,
3126
  'sub_fields' => array(
3127
  array(
@@ -3224,7 +3224,7 @@ acf_add_local_field_group(array(
3224
  ),
3225
  'acfe_permissions' => '',
3226
  'layout' => 'block',
3227
- 'acfe_seemless_style' => true,
3228
  'acfe_group_modal' => 0,
3229
  'sub_fields' => array(
3230
  array(
@@ -3327,7 +3327,7 @@ acf_add_local_field_group(array(
3327
  ),
3328
  'acfe_permissions' => '',
3329
  'layout' => 'block',
3330
- 'acfe_seemless_style' => true,
3331
  'acfe_group_modal' => 0,
3332
  'sub_fields' => array(
3333
  array(
@@ -3431,7 +3431,7 @@ acf_add_local_field_group(array(
3431
  ),
3432
  'acfe_permissions' => '',
3433
  'layout' => 'block',
3434
- 'acfe_seemless_style' => true,
3435
  'acfe_group_modal' => 0,
3436
  'sub_fields' => array(
3437
  array(
@@ -3534,7 +3534,7 @@ acf_add_local_field_group(array(
3534
  ),
3535
  'acfe_permissions' => '',
3536
  'layout' => 'block',
3537
- 'acfe_seemless_style' => true,
3538
  'acfe_group_modal' => 0,
3539
  'sub_fields' => array(
3540
  array(
@@ -3637,7 +3637,7 @@ acf_add_local_field_group(array(
3637
  ),
3638
  'acfe_permissions' => '',
3639
  'layout' => 'block',
3640
- 'acfe_seemless_style' => true,
3641
  'acfe_group_modal' => 0,
3642
  'sub_fields' => array(
3643
  array(
@@ -3740,7 +3740,7 @@ acf_add_local_field_group(array(
3740
  ),
3741
  'acfe_permissions' => '',
3742
  'layout' => 'block',
3743
- 'acfe_seemless_style' => true,
3744
  'acfe_group_modal' => 0,
3745
  'sub_fields' => array(
3746
  array(
@@ -3843,7 +3843,7 @@ acf_add_local_field_group(array(
3843
  ),
3844
  'acfe_permissions' => '',
3845
  'layout' => 'block',
3846
- 'acfe_seemless_style' => true,
3847
  'acfe_group_modal' => 0,
3848
  'sub_fields' => array(
3849
  array(
@@ -3946,7 +3946,7 @@ acf_add_local_field_group(array(
3946
  ),
3947
  'acfe_permissions' => '',
3948
  'layout' => 'block',
3949
- 'acfe_seemless_style' => true,
3950
  'acfe_group_modal' => 0,
3951
  'sub_fields' => array(
3952
  array(
104
  ),
105
  'acfe_permissions' => '',
106
  'layout' => 'block',
107
+ 'acfe_seamless_style' => true,
108
  'acfe_group_modal' => 0,
109
  'conditional_logic' => array(
110
  array(
217
  ),
218
  'acfe_permissions' => '',
219
  'layout' => 'block',
220
+ 'acfe_seamless_style' => true,
221
  'acfe_group_modal' => 0,
222
  'conditional_logic' => array(),
223
  'sub_fields' => array(
1260
  ),
1261
  'acfe_permissions' => '',
1262
  'layout' => 'block',
1263
+ 'acfe_seamless_style' => true,
1264
  'acfe_group_modal' => 0,
1265
  'sub_fields' => array(
1266
  array(
1364
  ),
1365
  'acfe_permissions' => '',
1366
  'layout' => 'block',
1367
+ 'acfe_seamless_style' => true,
1368
  'acfe_group_modal' => 0,
1369
  'sub_fields' => array(
1370
  array(
1468
  ),
1469
  'acfe_permissions' => '',
1470
  'layout' => 'block',
1471
+ 'acfe_seamless_style' => true,
1472
  'acfe_group_modal' => 0,
1473
  'sub_fields' => array(
1474
  array(
2256
  ),
2257
  'acfe_permissions' => '',
2258
  'layout' => 'block',
2259
+ 'acfe_seamless_style' => true,
2260
  'acfe_group_modal' => 0,
2261
  'sub_fields' => array(
2262
  array(
2359
  ),
2360
  'acfe_permissions' => '',
2361
  'layout' => 'block',
2362
+ 'acfe_seamless_style' => true,
2363
  'acfe_group_modal' => 0,
2364
  'sub_fields' => array(
2365
  array(
2574
  ),
2575
  'acfe_permissions' => '',
2576
  'layout' => 'block',
2577
+ 'acfe_seamless_style' => true,
2578
  'acfe_group_modal' => 0,
2579
  'sub_fields' => array(
2580
  array(
3121
  ),
3122
  'acfe_permissions' => '',
3123
  'layout' => 'block',
3124
+ 'acfe_seamless_style' => true,
3125
  'acfe_group_modal' => 0,
3126
  'sub_fields' => array(
3127
  array(
3224
  ),
3225
  'acfe_permissions' => '',
3226
  'layout' => 'block',
3227
+ 'acfe_seamless_style' => true,
3228
  'acfe_group_modal' => 0,
3229
  'sub_fields' => array(
3230
  array(
3327
  ),
3328
  'acfe_permissions' => '',
3329
  'layout' => 'block',
3330
+ 'acfe_seamless_style' => true,
3331
  'acfe_group_modal' => 0,
3332
  'sub_fields' => array(
3333
  array(
3431
  ),
3432
  'acfe_permissions' => '',
3433
  'layout' => 'block',
3434
+ 'acfe_seamless_style' => true,
3435
  'acfe_group_modal' => 0,
3436
  'sub_fields' => array(
3437
  array(
3534
  ),
3535
  'acfe_permissions' => '',
3536
  'layout' => 'block',
3537
+ 'acfe_seamless_style' => true,
3538
  'acfe_group_modal' => 0,
3539
  'sub_fields' => array(
3540
  array(
3637
  ),
3638
  'acfe_permissions' => '',
3639
  'layout' => 'block',
3640
+ 'acfe_seamless_style' => true,
3641
  'acfe_group_modal' => 0,
3642
  'sub_fields' => array(
3643
  array(
3740
  ),
3741
  'acfe_permissions' => '',
3742
  'layout' => 'block',
3743
+ 'acfe_seamless_style' => true,
3744
  'acfe_group_modal' => 0,
3745
  'sub_fields' => array(
3746
  array(
3843
  ),
3844
  'acfe_permissions' => '',
3845
  'layout' => 'block',
3846
+ 'acfe_seamless_style' => true,
3847
  'acfe_group_modal' => 0,
3848
  'sub_fields' => array(
3849
  array(
3946
  ),
3947
  'acfe_permissions' => '',
3948
  'layout' => 'block',
3949
+ 'acfe_seamless_style' => true,
3950
  'acfe_group_modal' => 0,
3951
  'sub_fields' => array(
3952
  array(
includes/modules/form/form-front.php CHANGED
@@ -429,16 +429,19 @@ class acfe_form_front{
429
 
430
  ?>
431
  <script>
432
- jQuery(document).ready(function($){
433
-
434
- if(typeof acf !== 'undefined'){
435
-
 
 
 
436
  acf.doAction('acfe/form/submit/success');
437
  acf.doAction('acfe/form/submit/success/name=<?php echo $args['form_name']; ?>');
438
-
439
- }
440
 
441
- });
 
 
442
  </script>
443
  <?php
444
 
429
 
430
  ?>
431
  <script>
432
+ (function($){
433
+
434
+ if(typeof acf === 'undefined')
435
+ return;
436
+
437
+ acf.addAction('prepare', function(){
438
+
439
  acf.doAction('acfe/form/submit/success');
440
  acf.doAction('acfe/form/submit/success/name=<?php echo $args['form_name']; ?>');
 
 
441
 
442
+ });
443
+
444
+ })(jQuery);
445
  </script>
446
  <?php
447
 
includes/modules/single-meta.php ADDED
@@ -0,0 +1,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!defined('ABSPATH'))
4
+ exit;
5
+
6
+ // Check setting
7
+ if(!acf_get_setting('acfe/modules/single_meta'))
8
+ return;
9
+
10
+ // Register notices store.
11
+ acf_register_store('acfe/meta')->prop('multisite', true);
12
+
13
+ if(!class_exists('acfe_single_meta')):
14
+
15
+ class acfe_single_meta{
16
+
17
+ public $data = array();
18
+ public $restricted = array();
19
+
20
+ function __construct(){
21
+
22
+ $this->restricted = array('acf-field-group', 'acf-field', 'attachment', 'acfe-dbt', 'acfe-dop', 'acfe-dpt', 'acfe-dt', 'acfe-form');
23
+
24
+ // Load
25
+ add_filter('acf/load_value', array($this, 'load_value'), 0, 3);
26
+ add_filter('acf/pre_load_metadata', array($this, 'load_reference'), 10, 4);
27
+
28
+ // Save
29
+ add_filter('acf/update_value', array($this, 'update_value'), 999, 4);
30
+ add_action('acf/save_post', array($this, 'save_post'), 999);
31
+
32
+ // Settings
33
+ add_action('acf/render_field_settings', array($this, 'field_setting'));
34
+
35
+ // Post
36
+ add_action('load-post.php', array($this, 'load_post'));
37
+ add_action('load-post-new.php', array($this, 'load_post'));
38
+
39
+ // Term
40
+ add_action('load-edit-tags.php', array($this, 'load_term'));
41
+ add_action('load-term.php', array($this, 'load_term'));
42
+
43
+ // User
44
+ add_action('load-user-new.php', array($this, 'load_user'));
45
+ add_action('load-user-edit.php', array($this, 'load_user'));
46
+ add_action('load-profile.php', array($this, 'load_user'));
47
+
48
+ }
49
+
50
+ /*
51
+ * Update Value
52
+ */
53
+ function update_value($value, $post_id, $field, $_value){
54
+
55
+ // Do not save empty values
56
+ //if(empty($value) && !is_numeric($value) && $field['type'] !== 'flexible_content' && $field['type'] !== 'clone' && $field['type'] !== 'group')
57
+ // return null;
58
+
59
+ // Validate Post ID
60
+ $validate = $this->validate_post_id($post_id);
61
+
62
+ if(!$validate)
63
+ return $value;
64
+
65
+ // Get store
66
+ $store = acf_get_store('acfe/meta');
67
+
68
+ // Store found
69
+ if($store->has("$post_id:acf")){
70
+
71
+ // Get Store: ACF meta
72
+ $acf = $store->get("$post_id:acf");
73
+
74
+ // Store not found
75
+ }else{
76
+
77
+ // Submitting acf/save_post
78
+ // Resetting values to empty
79
+ if(acf_maybe_get_POST('acf')){
80
+
81
+ $acf = array();
82
+
83
+ // Single update
84
+ }else{
85
+
86
+ // Get ACF meta
87
+ $acf = acf_get_metadata($post_id, 'acf');
88
+
89
+ }
90
+
91
+ // Set Store: ACF meta
92
+ $store->set("$post_id:acf", $acf);
93
+
94
+ }
95
+
96
+ $acf['_' . $field['name']] = $field['key'];
97
+ $acf[$field['name']] = $value;
98
+
99
+ // Save to ACF meta
100
+ acf_update_metadata($post_id, 'acf', $acf);
101
+
102
+ // Set Store: ACF meta
103
+ $store->set("$post_id:acf", $acf);
104
+
105
+ // Field Setting: Save individually
106
+ if(acf_maybe_get($field, 'acfe_save_meta'))
107
+ return $value;
108
+
109
+ // Do not save as individual meta
110
+ return null;
111
+
112
+ }
113
+
114
+ /*
115
+ * Load Single Meta
116
+ */
117
+ function load_value($value, $post_id, $field){
118
+
119
+ // Value already exists
120
+ if((!empty($value) || is_numeric($value)) && acf_maybe_get($field, 'default_value') !== $value)
121
+ return $value;
122
+
123
+ // Validate Post ID
124
+ $validate = $this->validate_post_id($post_id);
125
+
126
+ if(!$validate)
127
+ return $value;
128
+
129
+ // Check store.
130
+ $store = acf_get_store('acfe/meta');
131
+
132
+ // Store found
133
+ if($store->has("$post_id:acf")){
134
+
135
+ // Get Store: ACF meta
136
+ $acf = $store->get("$post_id:acf");
137
+
138
+ // Store not found
139
+ }else{
140
+
141
+ // Get ACF meta
142
+ $acf = acf_get_metadata($post_id, 'acf');
143
+
144
+ // Set Store: ACF meta
145
+ $store->set("$post_id:acf", $acf);
146
+
147
+ }
148
+
149
+ // ACF meta not found
150
+ if(empty($acf))
151
+ return $value;
152
+
153
+ $field_name = $field['name'];
154
+
155
+ if(isset($acf[$field_name])){
156
+
157
+ $value = $acf[$field_name];
158
+
159
+ }
160
+
161
+ return $value;
162
+
163
+ }
164
+
165
+ /*
166
+ * Pre Load Get Field
167
+ */
168
+ function load_reference($value, $post_id, $name, $hidden){
169
+
170
+ if(!$hidden)
171
+ return $value;
172
+
173
+ // Validate Post ID
174
+ $validate = $this->validate_post_id($post_id);
175
+
176
+ if(!$validate)
177
+ return $value;
178
+
179
+ // Check store.
180
+ $store = acf_get_store('acfe/meta');
181
+
182
+ // Store found
183
+ if($store->has("$post_id:acf")){
184
+
185
+ // Get Store: ACF meta
186
+ $acf = $store->get("$post_id:acf");
187
+
188
+ // Store not found
189
+ }else{
190
+
191
+ // Get ACF meta
192
+ $acf = acf_get_metadata($post_id, 'acf');
193
+
194
+ // Set Store: ACF meta
195
+ $store->set("$post_id:acf", $acf);
196
+
197
+ }
198
+
199
+ if(empty($acf))
200
+ return $value;
201
+
202
+ if(isset($acf["_{$name}"])){
203
+
204
+ $value = $acf["_{$name}"];
205
+
206
+ }
207
+
208
+ return $value;
209
+
210
+ }
211
+
212
+ function validate_post_id($post_id){
213
+
214
+ // Type + ID
215
+ extract(acf_decode_post_id($post_id));
216
+
217
+ // Validate ID
218
+ if(!$id)
219
+ return false;
220
+
221
+ // Exclude options
222
+ if($type === 'option')
223
+ return false;
224
+
225
+ // Get store
226
+ $store = acf_get_store('acfe/meta');
227
+
228
+ // Restrict post type
229
+ if($type === 'post'){
230
+
231
+ $allowed = false;
232
+
233
+ // Allowed found
234
+ if($store->has("$post_id:allowed")){
235
+
236
+ // Get Store: Allowed
237
+ $allowed = $store->get("$post_id:allowed");
238
+
239
+ // Allowed not found
240
+ }else{
241
+
242
+ $post_type = get_post_type($id);
243
+
244
+ if(!in_array($post_type, $this->restricted)){
245
+
246
+ $allowed = true;
247
+
248
+ }
249
+
250
+ $store->set("$post_id:allowed", $allowed);
251
+
252
+ }
253
+
254
+ if(!$allowed)
255
+ return false;
256
+
257
+ }
258
+
259
+ return true;
260
+
261
+ }
262
+
263
+ /*
264
+ * Delete orphan meta
265
+ */
266
+ function save_post($post_id = 0){
267
+
268
+ if(!acf_maybe_get_POST('acfe_clean_meta'))
269
+ return;
270
+
271
+ // $type + $id
272
+ extract(acf_decode_post_id($post_id));
273
+
274
+ // Exclude option
275
+ if($type === 'option')
276
+ return;
277
+
278
+ $acf = acf_get_metadata($post_id, 'acf');
279
+ if(empty($acf))
280
+ return;
281
+
282
+ $meta = acf_get_meta($post_id);
283
+ if(empty($meta))
284
+ return;
285
+
286
+ foreach($meta as $key => $value){
287
+
288
+ // bail if reference key does not exist
289
+ if(!isset($meta["_$key"]))
290
+ continue;
291
+
292
+ if(isset($acf[$key]))
293
+ continue;
294
+
295
+ acf_delete_metadata($post_id, $key);
296
+ acf_delete_metadata($post_id, $key, true);
297
+
298
+ }
299
+
300
+ }
301
+
302
+ /*
303
+ * Field Setting
304
+ */
305
+ function field_setting($field){
306
+
307
+ // Settings
308
+ acf_render_field_setting($field, array(
309
+ 'label' => __('Save as meta'),
310
+ 'key' => 'acfe_save_meta',
311
+ 'name' => 'acfe_save_meta',
312
+ 'instructions' => __('Save the field an individual meta (useful for WP_Query).'),
313
+ 'type' => 'true_false',
314
+ 'required' => false,
315
+ 'conditional_logic' => false,
316
+ 'wrapper' => array(
317
+ 'width' => '',
318
+ 'class' => '',
319
+ 'id' => '',
320
+ ),
321
+ 'message' => '',
322
+ 'default_value' => false,
323
+ 'ui' => true,
324
+ 'ui_on_text' => '',
325
+ 'ui_off_text' => '',
326
+ ));
327
+
328
+ }
329
+
330
+ function load_post(){
331
+
332
+ // globals
333
+ global $typenow;
334
+
335
+ // restrict specific post types
336
+ $restricted = array('acf-field-group', 'attachment', 'acfe-dbt', 'acfe-dop', 'acfe-dpt', 'acfe-dt', 'acfe-form');
337
+
338
+ if(in_array($typenow, $restricted))
339
+ return;
340
+
341
+ // actions
342
+ add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 10, 2);
343
+
344
+ }
345
+
346
+ function add_meta_boxes($post_type, $post){
347
+
348
+ add_meta_box('acfe-clean-meta', 'ACF Single Meta', array($this, 'render_metabox'), $post_type, 'side', 'core');
349
+
350
+ }
351
+
352
+ function load_term(){
353
+
354
+ $screen = get_current_screen();
355
+ $taxonomy = $screen->taxonomy;
356
+
357
+ // actions
358
+ add_action("{$taxonomy}_edit_form", array($this, 'edit_term'), 20, 2);
359
+
360
+ }
361
+
362
+ function edit_term($term, $taxonomy){
363
+
364
+ add_meta_box('acfe-clean-meta', 'ACF Single Meta', array($this, 'render_metabox'), 'edit-' . $term->taxonomy, 'side', 'core');
365
+
366
+ }
367
+
368
+ function load_user(){
369
+
370
+ add_meta_box('acfe-clean-meta', 'ACF Single Meta', array($this, 'render_metabox'), 'edit-user', 'normal', 'default');
371
+
372
+ }
373
+
374
+ function render_metabox($post, $metabox){
375
+
376
+ $field = array(
377
+ 'key' => false,
378
+ 'label' => false,
379
+ 'name' => 'acfe_clean_meta',
380
+ 'prefix' => false,
381
+ 'type' => 'true_false',
382
+ 'instructions' => '',
383
+ 'required' => 0,
384
+ 'conditional_logic' => 0,
385
+ 'wrapper' => array(
386
+ 'width' => '',
387
+ 'class' => '',
388
+ 'id' => '',
389
+ ),
390
+ 'message' => 'Clean orphan meta data',
391
+ 'default_value' => 0,
392
+ 'ui' => 0,
393
+ 'ui_on_text' => '',
394
+ 'ui_off_text' => '',
395
+ );
396
+
397
+ acf_render_field_wrap($field);
398
+
399
+ ?>
400
+ <script type="text/javascript">
401
+ if( typeof acf !== 'undefined' ) {
402
+
403
+ acf.newPostbox({
404
+ 'id': 'acfe-clean-meta',
405
+ 'label': 'top'
406
+ });
407
+
408
+ }
409
+ </script>
410
+ <?php
411
+
412
+ }
413
+
414
+ }
415
+
416
+ new acfe_single_meta();
417
+
418
+ endif;
includes/modules/taxonomy.php CHANGED
@@ -1,172 +1,174 @@
1
- <?php
2
-
3
- if(!defined('ABSPATH'))
4
- exit;
5
-
6
- // Check setting
7
- if(!acf_get_setting('acfe/modules/taxonomies'))
8
- return;
9
-
10
- /**
11
- * Terms List View
12
- */
13
- add_action('admin_footer-edit-tags.php', 'acfe_better_taxonomy_admin_footer');
14
- function acfe_better_taxonomy_admin_footer(){
15
-
16
- global $tax;
17
- $can_edit_terms = current_user_can($tax->cap->edit_terms);
18
-
19
- ?>
20
- <script type="text/html" id="tmpl-acfe-bt-admin-button-add">
21
- <?php if($can_edit_terms){ ?>
22
- <a href="#" class="page-title-action acfe-bt-admin-button-add"><?php echo $tax->labels->add_new_item; ?></a>
23
- <?php } ?>
24
- </script>
25
-
26
- <script type="text/html" id="tmpl-acfe-bt-wrapper">
27
- <div id="poststuff"></div>
28
- </script>
29
-
30
- <script type="text/javascript">
31
- (function($){
32
- // Add button
33
- $('.wrap .wp-heading-inline').after($('#tmpl-acfe-bt-admin-button-add').html());
34
-
35
- // Move form
36
- $('#ajax-response').after($('#col-container #col-left').addClass('acfe-bt'));
37
-
38
- // Hide form
39
- $('.acfe-bt').hide();
40
-
41
- // Create wrapper
42
- $('.acfe-bt .form-wrap').append($('#tmpl-acfe-bt-wrapper').html());
43
-
44
- // Append form inside wrapper
45
- $('.acfe-bt #poststuff').append($('.acfe-bt .form-wrap form'));
46
-
47
- $('.acfe-bt .form-wrap form').wrapInner('<div class="postbox" id="acfe-bt-form"><div class="inside"></div></div>');
48
-
49
- // Append new title
50
- $('.acfe-bt .postbox h2 span').append($('.acfe-bt .form-wrap > h2').text());
51
- $('.acfe-bt .form-wrap > h2').remove();
52
-
53
- // Acf class
54
- $('.acfe-bt .inside .form-field, .acfe-bt .inside .submit').addClass('acf-field');
55
-
56
- $('.acfe-bt .inside .form-field, .acfe-bt .inside .submit').each(function(){
57
-
58
- $(this).append('<div class="acf-input"></div>');
59
- $(this).find('.acf-input').append($(this).find('> :not("label")'));
60
-
61
- // Add spacing when a meta field has no label
62
- var $label = $(this).find('> label');
63
- if($label.length){
64
-
65
- $label.wrap('<div class="acf-label"></div>');
66
-
67
- }else{
68
-
69
- $(this).addClass('acfe-bt-no-label');
70
-
71
- }
72
-
73
- });
74
-
75
- // Remove ACF Fields id
76
- $('#acf-term-fields').contents().unwrap();
77
-
78
- $('.acfe-bt-admin-button-add').click(function(e){
79
-
80
- e.preventDefault();
81
-
82
- if($('.acfe-bt').is(':visible'))
83
- $('.acfe-bt').hide();
84
- else
85
- $('.acfe-bt').show();
86
-
87
- });
88
-
89
- // Label to left
90
- if(typeof acf !== 'undefined'){
91
- acf.postbox.render({
92
- 'id': 'acfe-bt-form',
93
- 'label': 'left'
94
- });
95
- }
96
-
97
- $('#acfe-bt-form .acf-tab-wrap.-left').removeClass('-left').addClass('-top');
98
-
99
- // Polylang Compatibility Fix
100
- <?php if(isset($_GET['from_tag']) && !empty($_GET['from_tag']) && isset($_GET['new_lang']) && !empty($_GET['new_lang'])){ ?>
101
-
102
- $('.acfe-bt-admin-button-add').click();
103
-
104
- <?php } ?>
105
-
106
- })(jQuery);
107
- </script>
108
- <?php
109
-
110
- }
111
-
112
- /**
113
- * Term Edit View
114
- */
115
- add_action('admin_footer-term.php', 'acfe_better_taxonomy_edit_admin_footer');
116
- function acfe_better_taxonomy_edit_admin_footer(){
117
-
118
- ?>
119
- <script type="text/html" id="tmpl-acf-column-2">
120
- <div class="acf-column-2">
121
-
122
- <div id="poststuff" class="acfe-acfe-bt-admin-column">
123
-
124
- <div class="postbox">
125
-
126
- <h2 class="hndle ui-sortable-handle"><span><?php _e('Edit', 'acfe'); ?></span></h2>
127
-
128
- <div class="inside">
129
- <div class="submitbox">
130
-
131
- <div id="major-publishing-actions">
132
-
133
- <div id="publishing-action">
134
-
135
- <div class="acfe-form-submit">
136
- <input type="submit" class="acf-button button button-primary button-large" value="<?php _e('Update', 'acfe'); ?>" />
137
- <span class="acf-spinner"></span>
138
- </div>
139
-
140
- </div>
141
- <div class="clear"></div>
142
-
143
- </div>
144
-
145
- </div>
146
-
147
- </div>
148
-
149
- </div>
150
-
151
- </div>
152
- </div>
153
- </script>
154
- <script type="text/javascript">
155
- (function($){
156
-
157
- // wrap form
158
- $('#edittag').wrapInner('<div class="acf-columns-2"><div style="float:left; width:100%;"></div></div>');
159
-
160
- // add column side
161
- $('#edittag .acf-columns-2').append($('#tmpl-acf-column-2').html());
162
-
163
- // Add acf-input
164
- //$('#edittag .form-table td:not(".acf-input")').wrapInner('<div class="acf-input"></div>');
165
-
166
- $('#edittag .edit-tag-actions').hide();
167
-
168
- })(jQuery);
169
- </script>
170
- <?php
171
-
 
 
172
  }
1
+ <?php
2
+
3
+ if(!defined('ABSPATH'))
4
+ exit;
5
+
6
+ // Check setting
7
+ if(!acf_get_setting('acfe/modules/taxonomies'))
8
+ return;
9
+
10
+ /**
11
+ * Terms List View
12
+ */
13
+ add_action('admin_footer-edit-tags.php', 'acfe_better_taxonomy_admin_footer');
14
+ function acfe_better_taxonomy_admin_footer(){
15
+
16
+ global $tax;
17
+ $can_edit_terms = current_user_can($tax->cap->edit_terms);
18
+
19
+ ?>
20
+ <script type="text/html" id="tmpl-acfe-bt-admin-button-add">
21
+ <?php if($can_edit_terms){ ?>
22
+ <a href="#" class="page-title-action acfe-bt-admin-button-add"><?php echo $tax->labels->add_new_item; ?></a>
23
+ <?php } ?>
24
+ </script>
25
+
26
+ <script type="text/html" id="tmpl-acfe-bt-wrapper">
27
+ <div id="poststuff"></div>
28
+ </script>
29
+
30
+ <script type="text/javascript">
31
+ (function($){
32
+ // Add button
33
+ $('.wrap .wp-heading-inline').after($('#tmpl-acfe-bt-admin-button-add').html());
34
+
35
+ // Move form
36
+ $('#ajax-response').after($('#col-container #col-left').addClass('acfe-bt'));
37
+
38
+ // Hide form
39
+ $('.acfe-bt').hide();
40
+
41
+ // Create wrapper
42
+ $('.acfe-bt .form-wrap').append($('#tmpl-acfe-bt-wrapper').html());
43
+
44
+ // Append form inside wrapper
45
+ $('.acfe-bt #poststuff').append($('.acfe-bt .form-wrap form'));
46
+
47
+ $('.acfe-bt .form-wrap form').wrapInner('<div class="postbox" id="acfe-bt-form"><div class="inside"></div></div>');
48
+
49
+ // Append new title
50
+ $('.acfe-bt .postbox h2 span').append($('.acfe-bt .form-wrap > h2').text());
51
+ $('.acfe-bt .form-wrap > h2').remove();
52
+
53
+ // Acf class
54
+ $('.acfe-bt .inside .form-field, .acfe-bt .inside .submit').addClass('acf-field');
55
+
56
+ $('.acfe-bt .inside .form-field, .acfe-bt .inside .submit').each(function(){
57
+
58
+ $(this).append('<div class="acf-input"></div>');
59
+ $(this).find('.acf-input').append($(this).find('> :not("label")'));
60
+
61
+ // Add spacing when a meta field has no label
62
+ var $label = $(this).find('> label');
63
+ if($label.length){
64
+
65
+ $label.wrap('<div class="acf-label"></div>');
66
+
67
+ }else{
68
+
69
+ $(this).addClass('acfe-bt-no-label');
70
+
71
+ }
72
+
73
+ });
74
+
75
+ // Remove ACF Fields id
76
+ $('#acf-term-fields').contents().unwrap();
77
+
78
+ $('.acfe-bt-admin-button-add').click(function(e){
79
+
80
+ e.preventDefault();
81
+
82
+ if($('.acfe-bt').is(':visible'))
83
+ $('.acfe-bt').hide();
84
+ else
85
+ $('.acfe-bt').show();
86
+
87
+ });
88
+
89
+ // Label to left
90
+ if(typeof acf !== 'undefined'){
91
+ acf.postbox.render({
92
+ 'id': 'acfe-bt-form',
93
+ 'label': 'left'
94
+ });
95
+ }
96
+
97
+ $('#acfe-bt-form .acf-tab-wrap.-left').removeClass('-left').addClass('-top');
98
+
99
+ // Polylang Compatibility Fix
100
+ <?php if(isset($_GET['from_tag']) && !empty($_GET['from_tag']) && isset($_GET['new_lang']) && !empty($_GET['new_lang'])){ ?>
101
+
102
+ $('.acfe-bt-admin-button-add').click();
103
+
104
+ <?php } ?>
105
+
106
+ })(jQuery);
107
+ </script>
108
+ <?php
109
+
110
+ }
111
+
112
+ /**
113
+ * Term Edit View
114
+ */
115
+ add_action('admin_footer-term.php', 'acfe_better_taxonomy_edit_admin_footer');
116
+ function acfe_better_taxonomy_edit_admin_footer(){
117
+
118
+ ?>
119
+ <script type="text/html" id="tmpl-acf-column-2">
120
+ <div class="acf-column-2">
121
+
122
+ <div id="poststuff" class="acfe-acfe-bt-admin-column">
123
+
124
+ <div class="postbox">
125
+
126
+ <h2 class="hndle ui-sortable-handle"><span><?php _e('Edit', 'acfe'); ?></span></h2>
127
+
128
+ <div class="inside">
129
+ <div class="submitbox">
130
+
131
+ <div id="major-publishing-actions">
132
+
133
+ <div id="publishing-action">
134
+
135
+ <div class="acfe-form-submit">
136
+ <input type="submit" class="acf-button button button-primary button-large" value="<?php _e('Update', 'acfe'); ?>" />
137
+ <span class="acf-spinner"></span>
138
+ </div>
139
+
140
+ </div>
141
+ <div class="clear"></div>
142
+
143
+ </div>
144
+
145
+ </div>
146
+
147
+ </div>
148
+
149
+ </div>
150
+
151
+ <?php do_meta_boxes(get_current_screen(), 'side', array()); ?>
152
+
153
+ </div>
154
+ </div>
155
+ </script>
156
+ <script type="text/javascript">
157
+ (function($){
158
+
159
+ // wrap form
160
+ $('#edittag').wrapInner('<div class="acf-columns-2"><div style="float:left; width:100%;"></div></div>');
161
+
162
+ // add column side
163
+ $('#edittag .acf-columns-2').append($('#tmpl-acf-column-2').html());
164
+
165
+ // Add acf-input
166
+ //$('#edittag .form-table td:not(".acf-input")').wrapInner('<div class="acf-input"></div>');
167
+
168
+ $('#edittag .edit-tag-actions').hide();
169
+
170
+ })(jQuery);
171
+ </script>
172
+ <?php
173
+
174
  }
init.php CHANGED
@@ -18,6 +18,20 @@ function acfe_include($filename = ''){
18
 
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * ACFE: ACF Pro Check
23
  */
18
 
19
  }
20
 
21
+ /**
22
+ * ACFE: Get URL
23
+ */
24
+ function acfe_get_url($filename = ''){
25
+
26
+ if(!defined('ACFE_URL')){
27
+
28
+ define('ACFE_URL', acf_get_setting('acfe/url'));
29
+
30
+ }
31
+
32
+ return ACFE_URL . ltrim($filename, '/');
33
+ }
34
+
35
  /**
36
  * ACFE: ACF Pro Check
37
  */
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.3
7
  Requires PHP: 5.6
8
- Stable tag: 0.8.3.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -23,6 +23,7 @@ All-in-one enhancement suite that improves WordPress & Advanced Custom Fields.
23
  * Bidirectional Fields
24
  * Advanced Fields Validation
25
  * Flexible Content as Page Builder
 
26
  * ACF Forms Manager
27
  * ACF Options Pages / Block Types Manager
28
  * ACF & WordPress Meta Overview
@@ -34,7 +35,7 @@ All-in-one enhancement suite that improves WordPress & Advanced Custom Fields.
34
  == 🤟 Philosophy ==
35
 
36
  * 100% free
37
- * Seemless integration
38
  * No extra menu, ads or notices
39
  * Built by developers, for developers
40
 
@@ -158,6 +159,9 @@ A more sophisticated validation conditions (AND/OR) with custom error messages b
158
  * **Permissions**
159
  Add permission layer to fields. Choose which roles can view & edit fields in the post edition screen. (can be combinated with field groups permissions)
160
 
 
 
 
161
  * **View raw data**
162
  Display raw field data in a modal to check your configuration & settings
163
 
@@ -248,6 +252,7 @@ Create and manage post types from your WordPress administration (Tools > Post Ty
248
  * Manage Posts per page, order by and order for the post type administration screen
249
  * Set custom single template (ie: `my-single.php`) instead of the native `single-{post_type}.php`
250
  * Set custom archive template (ie: `my-archive.php`) instead of the native `archive-{post_type}.php`
 
251
  * Manual PHP/Json Import & Export is available in the ACF > Tools page
252
 
253
  = WordPress: Dynamic Taxonomies =
@@ -284,9 +289,9 @@ Display all ACF Extended settings in one page.
284
 
285
  = ACF: Dev Mode =
286
 
287
- Display all custom Post Meta & Terms Meta in a readable format
288
 
289
- * Arrays & json are converted to `print_r()`
290
  * ACF fields meta are grouped together
291
  * ACF field groups related to fields are displayed when available
292
  * Dev mode also enable `SCRIPT_DEBUG`
@@ -318,6 +323,7 @@ Manage ACF Block Types from ACF > Block Types.
318
  * Hide Empty Message: Hide the native Flexible Content 'Empty' message
319
  * Empty Message: Change the native Flexible Content 'Click the Add Row button below...' message
320
  * Layouts Thumbnails: Add thumbnails for each layout in the layout selection
 
321
  * 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))
322
  * Layouts Dynamic Preview: Edit & Preview Layouts on-the-fly from your WordPress administration, just like in Gutenberg (Layouts Render must be turned ON)
323
  * Modal Edition: Edit layouts in a modal
@@ -331,6 +337,8 @@ Manage ACF Block Types from ACF > Block Types.
331
  * 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
332
  * Lock Flexible Content: Disable sortable layouts using `filter('acfe/flexible/lock/name=my_flexible', true, $field)`
333
  * Remove Actions Buttons: Remove the action buttons using `filter('acfe/flexible/remove_actions/name=my_flexible', true, $field)`
 
 
334
 
335
  = ACF: Dynamic Forms =
336
 
@@ -354,6 +362,28 @@ Manage ACF Forms from your WordPress administration. All ACF Form settings are a
354
  * The function `acf_form_head()` is not needed anymore
355
  * Manual Import & Export is available in the ACF > Tools page
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  == ❤️ Supporters ==
358
 
359
  * Thanks to [Brandon A.](https://twitter.com/AsmussenBrandon) for his support & tests
@@ -648,6 +678,46 @@ function my_acfe_modules(){
648
 
649
  == Changelog ==
650
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
  = 0.8.3.1 =
652
  * Field: Flexible Content - Fixed PHP `Undefined index: acfe_flexible_modal` notice
653
  * Fields: Select2 CSS Enhanced - Fixed forced height when in multiple mode
@@ -696,7 +766,7 @@ function my_acfe_modules(){
696
  * Dynamic Forms: Added action alias name setting for each action allowing better targeting when using hooks
697
  * Dynamic Forms: Reworked forms actions hooks and added 'Advanced' tab for each action with code examples
698
  * Field: Groups/Clones - CSS integration tweaks are now optional (Thanks @Brandon A.)
699
- * Field: Groups/Clones - Added "Seemless style" setting which enable better CSS integration (remove borders and padding)
700
  * Field: Code Editor - Added Field (use the WP Core CodeMirror script)
701
  * Field: Taxonomy Terms - Added advanced settings allowing specific taxonomies or specific terms in the field (with level or parent/child dependencies)
702
  * Field: reCaptcha - Fixed a bug where reCaptcha would not work properly
5
  Requires at least: 4.9
6
  Tested up to: 5.3
7
  Requires PHP: 5.6
8
+ Stable tag: 0.8.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
23
  * Bidirectional Fields
24
  * Advanced Fields Validation
25
  * Flexible Content as Page Builder
26
+ * Compress ACF values into a single metadata
27
  * ACF Forms Manager
28
  * ACF Options Pages / Block Types Manager
29
  * ACF & WordPress Meta Overview
35
  == 🤟 Philosophy ==
36
 
37
  * 100% free
38
+ * Seamless integration
39
  * No extra menu, ads or notices
40
  * Built by developers, for developers
41
 
159
  * **Permissions**
160
  Add permission layer to fields. Choose which roles can view & edit fields in the post edition screen. (can be combinated with field groups permissions)
161
 
162
+ * **Save as Meta**
163
+ Exclude the field from the "Single Meta Save" compression feature. The global ACF setting "Single Meta Save" must be turned ON.
164
+
165
  * **View raw data**
166
  Display raw field data in a modal to check your configuration & settings
167
 
252
  * Manage Posts per page, order by and order for the post type administration screen
253
  * Set custom single template (ie: `my-single.php`) instead of the native `single-{post_type}.php`
254
  * Set custom archive template (ie: `my-archive.php`) instead of the native `archive-{post_type}.php`
255
+ * Add an Archive Option Page under the post type menu and set your field groups
256
  * Manual PHP/Json Import & Export is available in the ACF > Tools page
257
 
258
  = WordPress: Dynamic Taxonomies =
289
 
290
  = ACF: Dev Mode =
291
 
292
+ View all custom Posts, Terms & Users meta in a readable format
293
 
294
+ * Print Arrays & Json values
295
  * ACF fields meta are grouped together
296
  * ACF field groups related to fields are displayed when available
297
  * Dev mode also enable `SCRIPT_DEBUG`
323
  * Hide Empty Message: Hide the native Flexible Content 'Empty' message
324
  * Empty Message: Change the native Flexible Content 'Click the Add Row button below...' message
325
  * Layouts Thumbnails: Add thumbnails for each layout in the layout selection
326
+ * Layouts Settings: Choose a field group to clone and to be used as a layout configuration modal in the administration
327
  * 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))
328
  * Layouts Dynamic Preview: Edit & Preview Layouts on-the-fly from your WordPress administration, just like in Gutenberg (Layouts Render must be turned ON)
329
  * Modal Edition: Edit layouts in a modal
337
  * 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
338
  * Lock Flexible Content: Disable sortable layouts using `filter('acfe/flexible/lock/name=my_flexible', true, $field)`
339
  * Remove Actions Buttons: Remove the action buttons using `filter('acfe/flexible/remove_actions/name=my_flexible', true, $field)`
340
+ * Asynchronous Layouts: Add layouts using Ajax method. This setting increase performance on complex Flexible Content
341
+ * Disable Legacy Layout Title Ajax: Disable the native ACF Layout Title Ajax call on `acf/fields/flexible_content/layout_title`.
342
 
343
  = ACF: Dynamic Forms =
344
 
362
  * The function `acf_form_head()` is not needed anymore
363
  * Manual Import & Export is available in the ACF > Tools page
364
 
365
+ = ACF: Single Meta Save (Beta) =
366
+
367
+ Compress all fields values from the current post, term or user into one single meta data. This process lighten the database load as values are saved and read from one single row. Once activated and after saving a post/term/user in the administration, all old meta data will be removed and packed together in a meta called `acf`.
368
+
369
+ To monitor the process, it is possible to enable the "ACF Extended: Dev Mode" which will display all WP & ACF meta data on every Posts, Terms & Users.
370
+
371
+ This feature also enables a new setting available in every fields: "Save as individual meta". If this setting is turned ON on a specific field, then the value will be saved individually. `WP Queries` and `Meta Queries` can be used just like before.
372
+
373
+ Single Meta Save is disabled by default. To enable it, add the following code in your `functions.php` file:
374
+
375
+ `
376
+ add_action('acf/init', 'my_acfe_modules');
377
+ function my_acfe_modules(){
378
+
379
+ // Enable Single Meta Save
380
+ acf_update_setting('acfe/modules/single_meta', true);
381
+
382
+ }
383
+ `
384
+
385
+ Note: It is possible to revert back to the native ACF save process. To do so, keep the feature enabled, get in the post administration you want to revert back. Disable the feature in your code, and save the post. All data will be saved back to individual meta datas.
386
+
387
  == ❤️ Supporters ==
388
 
389
  * Thanks to [Brandon A.](https://twitter.com/AsmussenBrandon) for his support & tests
678
 
679
  == Changelog ==
680
 
681
+ = 0.8.4 =
682
+ * Module: Added Single Meta Save feature - Compress all fields values from the current post, term or user into one single meta data. This feature is disabled by default, to enable it, use `acf_update_setting('acfe/modules/single_meta', true);`. More informations available in the readme.
683
+ * Module: Dynamic Post Types - Added `while(have_archive()): the_archive();` logic when the "Admin Archive Page" setting is turned on. This template tags can be used in the `archive-post-type.php` template which makes `get_field('my_field')` calls easier
684
+ * Module: Dynamic Post Types/Taxonomies - Fixed Posts/Terms column data when object was trashed.
685
+ * Module: PHP AutoSync - PHP sync files are now removed when the field group is disabled/trashed.
686
+ * Module: Dynamic Forms - In the "E-mail Action" the "From" field is now required.
687
+ * Module: Dynamic Forms - The Javascript hook `acfe/form/submit/success` is now correctly fired on form submission
688
+ * Module: Dev Mode - Added the WP & ACF Meta Overview on User pages
689
+ * Module: Dynamic Post Types/Taxonomies/Options Pages/Block Types - Removed Draft button action
690
+ * Field: Flexible Content - Significant Performance Boost (~50/60% faster during the loading). Many settings are now loaded in PHP. This massive rework brings some great performance on complex Flexible Content fields.
691
+ * Field: Flexible Content - Added "Layouts: Asynchronous" setting which add layouts using Ajax method (instead of having hidden layouts models in the DOM). This setting increase performance on complex Flexible Content fields.
692
+ * Field: Flexible Content - Added "Layouts: Settings" setting which let you choose a field group to clone and to be used as a configuration modal for each layout. Settings can then be used using `while(have_settings()): the_setting(); get_sub_field('my_setting');` in the Layout Template.
693
+ * Field: Flexible Content - Initial "Dynamic Preview" are now processed during page administration load, and not Ajax anymore. This tweak also speed-up the loading speed.
694
+ * Field: Flexible Content - Fixed a potential duplicated categories bug in the Selection Modal if the category name had spaces.
695
+ * Field: Flexible Content - "Remove Actions" now correctly remove Clone & Copy/Paste buttons.
696
+ * Field: Flexible Content - Added "Disable Legacy Layout Title Ajax" setting. It disables the native ACF Layout Title Ajax call on `acf/fields/flexible_content/layout_title`.
697
+ * Field: Flexible Content - Fixed the `$is_preview` variable not being available in specific situations.
698
+ * Field: Flexible Content - Fixed Dynamic Preview repeater fields inside a layout which could send an additional `acfcloneindex` during the preview mode
699
+ * Field: Flexible Content - Fixed Dynamic Preview with WP Query in the layout, which could be duplicated due to how WP Admin manage custom queries
700
+ * Field: Flexible Content - Fixed "Edit" icon vertical align with the latest WP 5.3 update
701
+ * Field: Flexible Content - Added shorter CSS class for preview wrapper `-preview`
702
+ * Field: Flexible Content - Fixed the native ACF setting "Select layout" with a wrong height on WP 5.3
703
+ * Field: Flexible Content - Fixed Enter key opening duplicated modal with Modal Edition setting
704
+ * Field: Flexible Content - Added `filter('acfe/flexible/layouts/div/name=my_flexible', $div, $layout, $field)` to change layout div attributes (with 5 variations)
705
+ * Field: Flexible Content - Added `filter('acfe/flexible/layouts/handle/name=my_flexible', $handle, $layout, $field)` to change layout handle attributes (with 5 variations)
706
+ * Field: Flexible Content - Added `filter('acfe/flexible/layouts/icons/name=my_flexible', $icons, $layout, $field)` to change layout handle icons (with 5 variations)
707
+ * Field: Flexible Content - Added `filter('acfe/flexible/secondary_actions/name=my_flexible', $secondary_actions, $field)` to change Flexible Content secondary actions (copy, paste...) (with 3 variations)
708
+ * Field: Advanced Link - Fixed required validation which could fail if a post object was selected.
709
+ * Field: Advanced Link - Fixed a `z-index` problem in menu/items
710
+ * Field: Code Editor - Added compatibility with WP Code Editor Settings (editor themes).
711
+ * Field: Group/Clone - In Seamless Style mode instructions could be truncated in some specific cases
712
+ * Field: Group/Clone - Seamless Style mode wasn't working correctly in the Term administration
713
+ * Field: Group/Clone - Fixed "Seamless Style" typo
714
+ * Field: Group/Clone - Fixed "Edit in modal" which wasn't correctly working in menus
715
+ * Field Group: Fixed Category sync which failed to create & set new field group category if not already available in WP
716
+ * Field Groups: Fixed empty field groups list colspan
717
+ * Fields: Post Statuses/Post Types/Taxonomies/Taxonomies Terms/User Roles can now be used as conditional display field
718
+ * General: ACF Extended now correctly detects ACF Pro when included in the WP Theme.
719
+ * General: ACF Extended can now be included in WP Themes (following the same logic as ACF)
720
+
721
  = 0.8.3.1 =
722
  * Field: Flexible Content - Fixed PHP `Undefined index: acfe_flexible_modal` notice
723
  * Fields: Select2 CSS Enhanced - Fixed forced height when in multiple mode
766
  * Dynamic Forms: Added action alias name setting for each action allowing better targeting when using hooks
767
  * Dynamic Forms: Reworked forms actions hooks and added 'Advanced' tab for each action with code examples
768
  * Field: Groups/Clones - CSS integration tweaks are now optional (Thanks @Brandon A.)
769
+ * Field: Groups/Clones - Added "Seamless style" setting which enable better CSS integration (remove borders and padding)
770
  * Field: Code Editor - Added Field (use the WP Core CodeMirror script)
771
  * Field: Taxonomy Terms - Added advanced settings allowing specific taxonomies or specific terms in the field (with level or parent/child dependencies)
772
  * Field: reCaptcha - Fixed a bug where reCaptcha would not work properly