Version Description
- Dynamic Forms: Fixed error position 'below' not working on some specific fields (Select)
- Dynamic Forms:
acfe_form_is_front()
&acfe_form_is_admin()
helpers now also check native ACF Form screen - Dynamic Forms: Added action alias name setting for each action allowing better targeting when using hooks
- Dynamic Forms: Reworked forms actions hooks and added 'Advanced' tab for each action with code examples
- Field: Groups/Clones - CSS integration tweaks are now optional (Thanks @Brandon A.)
- Field: Groups/Clones - Added "Seemless style" setting which enable better CSS integration (remove borders and padding)
- Field: Code Editor - Added Field (use the WP Core CodeMirror script)
- Field: Taxonomy Terms - Added advanced settings allowing specific taxonomies or specific terms in the field (with level or parent/child dependencies)
- Field: reCaptcha - Fixed a bug where reCaptcha would not work properly
- Field: Flexible Content - Updated JS filter
acf.doAction('acfe/fields/flexible_content/preview', response, flexible.$el, $layout, ajaxData)
& moved it after preview HTML parse - Field: Flexible Content - Updated JS filters & added variations
acf.doAction('acfe/fields/flexible_content/preview/name=my_flexible&layout=my_layout', response, flexible.$el, $layout, ajaxData)
- Field: Flexible Content - Fixed "Remove Collapse" setting not working on newly added layout (Moved RemoveCollapse from acf-extended-fc-control.js to acf-extended-fc.js (acfe/flexible/layouts))
- Fields: Fields are now registered using
acf_register_field_type()
. This will allow developers to useacf_get_field_type('acfe_field')
- Fields settings: Bidirectional - Added filter which allow to force related field to be updated when migrating from already existant values
- Fields settings: Bidirectional - Added
filter('acfe/bidirectional/force_update/name=my_field', true, $field, $post_id)
(available with /type & /key) (Feature request: @anjanphukan) - Field Groups: Fixed CSS which wrongly hide instructions when there's no field label (Thanks @Damien C.)
- Field Groups: Third Party - Added PHP filter to change source column output
filter('acfe/field_groups_third_party/source', $source, $post_id, $field_group)
- General: Added
filter('acfe/field_wrapper_attributes/type=$field_type', $wrapper, $field)
(also with /name & /key variations) - General: Splitted CSS for front-end/back-end
- General: Fixed ACF Setting Tab "Module: Taxonomies Enhancements" title (thanks @doublesharp)
Download this release
Release Info
Developer | hwk-fr |
Plugin | Advanced Custom Fields: Extended |
Version | 0.8.2 |
Comparing to | |
See all releases |
Code changes from version 0.8.1 to 0.8.2
- acf-extended.php +3 -2
- assets/acf-extended-admin.css +197 -0
- assets/acf-extended-fc-control.js +0 -8
- assets/acf-extended-fc.js +19 -3
- assets/acf-extended-fg.css +11 -0
- assets/acf-extended-fields.js +234 -0
- assets/acf-extended-form.js +24 -1
- assets/acf-extended.css +95 -268
- includes/admin/settings.php +1 -1
- includes/core/enqueue.php +2 -1
- includes/core/helpers.php +40 -2
- includes/field-groups/field-groups.php +9 -3
- includes/fields-settings/bidirectional.php +20 -1
- includes/fields-settings/fields.php +11 -0
- includes/fields/field-advanced-link.php +6 -1
- includes/fields/field-button.php +6 -1
- includes/fields/field-clone.php +38 -7
- includes/fields/field-code-editor.php +141 -0
- includes/fields/field-column.php +13 -10
- includes/fields/field-dynamic-message.php +6 -1
- includes/fields/field-flexible-content.php +1 -4
- includes/fields/field-forms.php +6 -1
- includes/fields/field-group.php +27 -4
- includes/fields/field-hidden.php +6 -1
- includes/fields/field-post-statuses.php +6 -1
- includes/fields/field-post-types.php +6 -1
- includes/fields/field-recaptcha.php +93 -120
- includes/fields/field-repeater.php +1 -4
- includes/fields/field-slug.php +6 -1
- includes/fields/field-taxonomies.php +6 -1
- includes/fields/field-taxonomy-terms.php +384 -5
- includes/fields/field-textarea.php +20 -6
- includes/fields/field-user-roles.php +6 -1
- includes/modules/form/actions/email.php +15 -5
- includes/modules/form/actions/option.php +2 -2
- includes/modules/form/actions/post.php +190 -13
- includes/modules/form/actions/term.php +179 -13
- includes/modules/form/actions/user.php +176 -13
- includes/modules/form/admin.php +37 -8
- includes/modules/form/field-group.php +305 -26
- includes/modules/form/form-front.php +29 -27
- readme.txt +27 -2
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.
|
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.
|
20 |
|
21 |
// Settings
|
22 |
var $settings = array();
|
@@ -188,6 +188,7 @@ class ACFE{
|
|
188 |
|
189 |
acfe_include('includes/fields/field-advanced-link.php');
|
190 |
acfe_include('includes/fields/field-button.php');
|
|
|
191 |
acfe_include('includes/fields/field-column.php');
|
192 |
acfe_include('includes/fields/field-dynamic-message.php');
|
193 |
acfe_include('includes/fields/field-forms.php');
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
+
* Version: 0.8.2
|
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.2';
|
20 |
|
21 |
// Settings
|
22 |
var $settings = array();
|
188 |
|
189 |
acfe_include('includes/fields/field-advanced-link.php');
|
190 |
acfe_include('includes/fields/field-button.php');
|
191 |
+
acfe_include('includes/fields/field-code-editor.php');
|
192 |
acfe_include('includes/fields/field-column.php');
|
193 |
acfe_include('includes/fields/field-dynamic-message.php');
|
194 |
acfe_include('includes/fields/field-forms.php');
|
assets/acf-extended-admin.css
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* ACFE General
|
3 |
+
*/
|
4 |
+
pre{
|
5 |
+
display: block;
|
6 |
+
padding: 9.5px;
|
7 |
+
margin: 0;
|
8 |
+
font-size: 13px;
|
9 |
+
line-height: 1.42857143;
|
10 |
+
color: #333;
|
11 |
+
word-break: break-all;
|
12 |
+
word-wrap: break-word;
|
13 |
+
background-color: #f5f5f5;
|
14 |
+
border: 1px solid #ccc;
|
15 |
+
border-radius: 1px;
|
16 |
+
white-space: pre-wrap;
|
17 |
+
overflow: auto;
|
18 |
+
}
|
19 |
+
|
20 |
+
code, kbd, pre, samp{
|
21 |
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
22 |
+
font-size: 1em;
|
23 |
+
}
|
24 |
+
|
25 |
+
/*
|
26 |
+
* ACFE: Postbox
|
27 |
+
*/
|
28 |
+
.acfe-postbox.acfe-postbox-no-handle h2.hndle{
|
29 |
+
cursor:initial;
|
30 |
+
}
|
31 |
+
|
32 |
+
.acfe-postbox.acfe-postbox-no-handle .handlediv{
|
33 |
+
display:none;
|
34 |
+
}
|
35 |
+
|
36 |
+
/*
|
37 |
+
* ACFE: Dynamic Post Type 'Setting' Button
|
38 |
+
*/
|
39 |
+
.wrap .acfe-dpt-admin-config,
|
40 |
+
.wrap .acfe-dpt-admin-config:active,
|
41 |
+
.wrap .acfe-dt-admin-config,
|
42 |
+
.wrap .acfe-dt-admin-config:active{
|
43 |
+
padding-left:4px;
|
44 |
+
padding-right:4px;
|
45 |
+
}
|
46 |
+
|
47 |
+
.wrap .acfe-dpt-admin-config span,
|
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 #minor-publishing{
|
63 |
+
display:none;
|
64 |
+
}
|
65 |
+
|
66 |
+
/*
|
67 |
+
* ACFE: Dynamic Taxonomy
|
68 |
+
*/
|
69 |
+
body.post-type-acfe-dt #minor-publishing{
|
70 |
+
display:none;
|
71 |
+
}
|
72 |
+
|
73 |
+
/*
|
74 |
+
* ACFE: Dynamic Options Page
|
75 |
+
*/
|
76 |
+
body.post-type-acfe-dop #minor-publishing{
|
77 |
+
display:none;
|
78 |
+
}
|
79 |
+
|
80 |
+
/*
|
81 |
+
* ACFE: Dynamic Block Type
|
82 |
+
*/
|
83 |
+
body.post-type-acfe-dbt #minor-publishing{
|
84 |
+
display:none;
|
85 |
+
}
|
86 |
+
|
87 |
+
/*
|
88 |
+
* ACFE: Author Label
|
89 |
+
*/
|
90 |
+
.acf-field.acf-field-acfe-author > .acf-label{
|
91 |
+
display:none;
|
92 |
+
}
|
93 |
+
|
94 |
+
/*
|
95 |
+
* Gutenberg: Fix metaboxes
|
96 |
+
*/
|
97 |
+
.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{
|
98 |
+
margin:10px 10px 0;
|
99 |
+
}
|
100 |
+
|
101 |
+
.edit-post-layout__metaboxes:not(:empty) {
|
102 |
+
background:#f3f4f5;
|
103 |
+
}
|
104 |
+
|
105 |
+
.edit-post-layout__metaboxes .edit-post-meta-boxes-area .postbox{
|
106 |
+
margin-bottom:10px;
|
107 |
+
}
|
108 |
+
|
109 |
+
/* Firefox fix only */
|
110 |
+
@supports (-moz-appearance:meterbar){
|
111 |
+
.edit-post-layout__metaboxes .postbox{
|
112 |
+
box-shadow:0 1px 1px 1px rgba(0,0,0,.04);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/*
|
117 |
+
* ACF Tools
|
118 |
+
*/
|
119 |
+
#acf-admin-tool-acfe_tool_dbt_export ul,
|
120 |
+
#acf-admin-tool-acfe_tool_dpt_export ul,
|
121 |
+
#acf-admin-tool-acfe_tool_dt_export ul,
|
122 |
+
#acf-admin-tool-acfe_tool_dop_export ul{
|
123 |
+
column-width: 200px;
|
124 |
+
}
|
125 |
+
|
126 |
+
.acf-meta-box-wrap.-grid #acf-admin-tool-acfe-fg-local{
|
127 |
+
display:none;
|
128 |
+
}
|
129 |
+
|
130 |
+
/*
|
131 |
+
* ACFE WP Options
|
132 |
+
*/
|
133 |
+
.settings_page_acfe-options .column-option_id{
|
134 |
+
width:65px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.settings_page_acfe-options .column-option_name{
|
138 |
+
width:435px;
|
139 |
+
}
|
140 |
+
|
141 |
+
.settings_page_acfe-options .column-autoload{
|
142 |
+
width:100px;
|
143 |
+
text-align:center;
|
144 |
+
}
|
145 |
+
|
146 |
+
/*
|
147 |
+
* ACFE Form
|
148 |
+
*/
|
149 |
+
.acf-field[data-name="acfe_form_post_save_post_title_custom"],
|
150 |
+
.acf-field[data-name="acfe_form_post_save_post_name_custom"],
|
151 |
+
.acf-field[data-name="acfe_form_post_save_post_content_custom"],
|
152 |
+
|
153 |
+
.acf-field[data-name="acfe_form_term_save_name_custom"],
|
154 |
+
.acf-field[data-name="acfe_form_term_save_slug_custom"],
|
155 |
+
.acf-field[data-name="acfe_form_term_save_description_custom"],
|
156 |
+
|
157 |
+
.acf-field[data-name="acfe_form_user_save_email_custom"],
|
158 |
+
.acf-field[data-name="acfe_form_user_save_username_custom"],
|
159 |
+
.acf-field[data-name="acfe_form_user_save_password_custom"],
|
160 |
+
.acf-field[data-name="acfe_form_user_save_first_name_custom"],
|
161 |
+
.acf-field[data-name="acfe_form_user_save_last_name_custom"],
|
162 |
+
.acf-field[data-name="acfe_form_user_save_nickname_custom"],
|
163 |
+
.acf-field[data-name="acfe_form_user_save_display_name_custom"],
|
164 |
+
.acf-field[data-name="acfe_form_user_save_website_custom"],
|
165 |
+
.acf-field[data-name="acfe_form_user_save_description_custom"]{
|
166 |
+
border-top:0;
|
167 |
+
padding-top:0;
|
168 |
+
}
|
169 |
+
|
170 |
+
.acf-field.acf-field-acfe-form-attributes > .acf-input > .acf-fields > .acf-field{
|
171 |
+
border-left-width:0;
|
172 |
+
}
|
173 |
+
|
174 |
+
.acf-field.acf-field-acfe-form-fields-attributes > .acf-input > .acf-fields > .acf-field{
|
175 |
+
border-left-width:0;
|
176 |
+
}
|
177 |
+
|
178 |
+
.acf-field-repeater.acf-field-acfe-form-email-files > .acf-input > .acf-repeater > .acf-actions{
|
179 |
+
text-align:left;
|
180 |
+
}
|
181 |
+
|
182 |
+
.acf-field-repeater.acf-field-acfe-form-email-files > .acf-input > .acf-repeater > .acf-actions > .acf-button{
|
183 |
+
color: #555;
|
184 |
+
border-color: #ccc;
|
185 |
+
background: #f7f7f7;
|
186 |
+
box-shadow: 0 1px 0 #ccc;
|
187 |
+
text-shadow:none;
|
188 |
+
}
|
189 |
+
|
190 |
+
/*
|
191 |
+
* ACFE Dev Mode
|
192 |
+
*/
|
193 |
+
.postbox#acfe-wp-custom-fields > .inside,
|
194 |
+
.postbox#acfe-acf-custom-fields > .inside{
|
195 |
+
padding:0;
|
196 |
+
margin:0;
|
197 |
+
}
|
assets/acf-extended-fc-control.js
CHANGED
@@ -692,14 +692,6 @@
|
|
692 |
|
693 |
}
|
694 |
|
695 |
-
// ACFE: Remove Collapse
|
696 |
-
if(flexible.has('acfeFlexibleRemoveCollapse')){
|
697 |
-
|
698 |
-
flexible.removeEvents({'click [data-name="collapse-layout"]': 'onClickCollapse'});
|
699 |
-
flexible.$layouts().find('> .acf-fc-layout-controls > [data-name="collapse-layout"]').remove();
|
700 |
-
|
701 |
-
}
|
702 |
-
|
703 |
if(flexible.has('acfeFlexibleCopyPaste')){
|
704 |
|
705 |
/*
|
692 |
|
693 |
}
|
694 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
if(flexible.has('acfeFlexibleCopyPaste')){
|
696 |
|
697 |
/*
|
assets/acf-extended-fc.js
CHANGED
@@ -132,7 +132,11 @@
|
|
132 |
value: acf.serialize($layout, prefix)
|
133 |
};
|
134 |
|
135 |
-
acf.doAction('acfe/fields/flexible_content/before_preview',
|
|
|
|
|
|
|
|
|
136 |
|
137 |
// ajax
|
138 |
$.ajax({
|
@@ -142,8 +146,6 @@
|
|
142 |
type: 'post',
|
143 |
success: function(response){
|
144 |
|
145 |
-
acf.doAction('acfe/fields/flexible_content/preview', response, flexible.$el, ajaxData);
|
146 |
-
|
147 |
if(response){
|
148 |
|
149 |
$placeholder.find('> .acfe-flexible-placeholder').html(response);
|
@@ -154,6 +156,12 @@
|
|
154 |
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
},
|
158 |
complete: function(){
|
159 |
|
@@ -227,6 +235,14 @@
|
|
227 |
|
228 |
}
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
// Bail early if layout is clone
|
231 |
if($layout.is('.acf-clone'))
|
232 |
return;
|
132 |
value: acf.serialize($layout, prefix)
|
133 |
};
|
134 |
|
135 |
+
acf.doAction('acfe/fields/flexible_content/before_preview', flexible.$el, $layout, ajaxData);
|
136 |
+
acf.doAction('acfe/fields/flexible_content/before_preview/name=' + flexible.get('name'), flexible.$el, $layout, ajaxData);
|
137 |
+
acf.doAction('acfe/fields/flexible_content/before_preview/key=' + flexible.get('key'), flexible.$el, $layout, ajaxData);
|
138 |
+
acf.doAction('acfe/fields/flexible_content/before_preview/name=' + flexible.get('name') + '&layout=' + $layout.data('layout'), flexible.$el, $layout, ajaxData);
|
139 |
+
acf.doAction('acfe/fields/flexible_content/before_preview/key=' + flexible.get('key') + '&layout=' + $layout.data('layout'), flexible.$el, $layout, ajaxData);
|
140 |
|
141 |
// ajax
|
142 |
$.ajax({
|
146 |
type: 'post',
|
147 |
success: function(response){
|
148 |
|
|
|
|
|
149 |
if(response){
|
150 |
|
151 |
$placeholder.find('> .acfe-flexible-placeholder').html(response);
|
156 |
|
157 |
}
|
158 |
|
159 |
+
acf.doAction('acfe/fields/flexible_content/preview', response, flexible.$el, $layout, ajaxData);
|
160 |
+
acf.doAction('acfe/fields/flexible_content/preview/name=' + flexible.get('name'), response, flexible.$el, $layout, ajaxData);
|
161 |
+
acf.doAction('acfe/fields/flexible_content/preview/key=' + flexible.get('key'), response, flexible.$el, $layout, ajaxData);
|
162 |
+
acf.doAction('acfe/fields/flexible_content/preview/name=' + flexible.get('name') + '&layout=' + $layout.data('layout'), response, flexible.$el, $layout, ajaxData);
|
163 |
+
acf.doAction('acfe/fields/flexible_content/preview/key=' + flexible.get('key') + '&layout=' + $layout.data('layout'), response, flexible.$el, $layout, ajaxData);
|
164 |
+
|
165 |
},
|
166 |
complete: function(){
|
167 |
|
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;
|
assets/acf-extended-fg.css
CHANGED
@@ -209,4 +209,15 @@ td.acf-field-group-category a{
|
|
209 |
|
210 |
.acf-field-object-acfe-column .li-field-name{
|
211 |
visibility: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
209 |
|
210 |
.acf-field-object-acfe-column .li-field-name{
|
211 |
visibility: hidden;
|
212 |
+
}
|
213 |
+
|
214 |
+
/*
|
215 |
+
* ACFE Taxonomy Terms
|
216 |
+
*/
|
217 |
+
.acf-field-setting-allow_terms > .acf-input > ul > li:first-of-type{
|
218 |
+
width: calc(100% - 110px);
|
219 |
+
}
|
220 |
+
|
221 |
+
.acf-field-setting-allow_terms > .acf-input > ul > li:last-of-type{
|
222 |
+
width: 110px;
|
223 |
}
|
assets/acf-extended-fields.js
CHANGED
@@ -1,8 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
(function($){
|
2 |
|
3 |
if(typeof acf === 'undefined')
|
4 |
return;
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Field: Textarea
|
8 |
*/
|
@@ -422,6 +631,31 @@
|
|
422 |
|
423 |
acf.registerFieldType(Column);
|
424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
var acfe_form_map_fields = function(field){
|
426 |
|
427 |
var name = field.get('name');
|
1 |
+
function acfe_recaptcha(){
|
2 |
+
|
3 |
+
(function($){
|
4 |
+
|
5 |
+
if(typeof acf === 'undefined')
|
6 |
+
return;
|
7 |
+
|
8 |
+
$.each(acf.getFields({type: 'acfe_recaptcha'}), function(i, field){
|
9 |
+
|
10 |
+
field.render();
|
11 |
+
|
12 |
+
});
|
13 |
+
|
14 |
+
})(jQuery);
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
(function($){
|
19 |
|
20 |
if(typeof acf === 'undefined')
|
21 |
return;
|
22 |
|
23 |
+
/**
|
24 |
+
* Field: reCaptcha
|
25 |
+
*/
|
26 |
+
var reCaptcha = acf.Field.extend({
|
27 |
+
|
28 |
+
type: 'acfe_recaptcha',
|
29 |
+
|
30 |
+
actions: {
|
31 |
+
'validation_failure' : 'validationFailure'
|
32 |
+
},
|
33 |
+
|
34 |
+
$control: function(){
|
35 |
+
return this.$('.acfe-field-recaptcha');
|
36 |
+
},
|
37 |
+
|
38 |
+
$input: function(){
|
39 |
+
return this.$('input[type="hidden"]');
|
40 |
+
},
|
41 |
+
|
42 |
+
$selector: function(){
|
43 |
+
return this.$control().find('> div');
|
44 |
+
},
|
45 |
+
|
46 |
+
selector: function(){
|
47 |
+
return this.$selector()[0];
|
48 |
+
},
|
49 |
+
|
50 |
+
version: function(){
|
51 |
+
return this.get('version');
|
52 |
+
},
|
53 |
+
|
54 |
+
render: function(){
|
55 |
+
|
56 |
+
var field = this;
|
57 |
+
|
58 |
+
if(this.version() === 'v2'){
|
59 |
+
|
60 |
+
this.recaptcha = grecaptcha.render(this.selector(), {
|
61 |
+
'sitekey': this.$control().data('site-key'),
|
62 |
+
'theme': this.$control().data('size'),
|
63 |
+
'size': this.$control().data('theme'),
|
64 |
+
|
65 |
+
|
66 |
+
'callback': function(response){
|
67 |
+
|
68 |
+
field.$input().val(response).change();
|
69 |
+
field.$input().closest('.acf-input').find('> .acf-notice.-error').hide();
|
70 |
+
|
71 |
+
},
|
72 |
+
|
73 |
+
'error-callback': function(){
|
74 |
+
|
75 |
+
field.$input().val('error').change();
|
76 |
+
|
77 |
+
},
|
78 |
+
|
79 |
+
'expired-callback': function(){
|
80 |
+
|
81 |
+
field.$input().val('expired').change();
|
82 |
+
|
83 |
+
}
|
84 |
+
});
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
else if(this.version() === 'v3'){
|
89 |
+
|
90 |
+
this.recaptcha = function(){
|
91 |
+
|
92 |
+
grecaptcha.ready(function(){
|
93 |
+
grecaptcha.execute(this.$control().data('site-key'), {action: 'homepage'}).then(function(response){
|
94 |
+
|
95 |
+
field.$input().val(response).change();
|
96 |
+
field.$input().closest('.acf-input').find('> .acf-notice.-error').hide();
|
97 |
+
|
98 |
+
});
|
99 |
+
});
|
100 |
+
|
101 |
+
};
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
},
|
106 |
+
|
107 |
+
validationFailure: function($form){
|
108 |
+
|
109 |
+
grecaptcha.reset(this.recaptcha);
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
});
|
114 |
+
|
115 |
+
acf.registerFieldType(reCaptcha);
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Field: Code Editor
|
120 |
+
*/
|
121 |
+
var CodeEditor = acf.Field.extend({
|
122 |
+
|
123 |
+
wait: 'ready',
|
124 |
+
|
125 |
+
type: 'acfe_code_editor',
|
126 |
+
|
127 |
+
events: {
|
128 |
+
'showField': 'onShow',
|
129 |
+
},
|
130 |
+
|
131 |
+
$control: function(){
|
132 |
+
|
133 |
+
return this.$el.find('> .acf-input > .acf-input-wrap');
|
134 |
+
|
135 |
+
},
|
136 |
+
|
137 |
+
$input: function(){
|
138 |
+
|
139 |
+
return this.$el.find('> .acf-input > .acf-input-wrap > textarea');
|
140 |
+
|
141 |
+
},
|
142 |
+
|
143 |
+
input: function(){
|
144 |
+
|
145 |
+
return this.$input()[0];
|
146 |
+
|
147 |
+
},
|
148 |
+
|
149 |
+
rows: function(){
|
150 |
+
|
151 |
+
return this.$input().attr('rows');
|
152 |
+
|
153 |
+
},
|
154 |
+
|
155 |
+
initialize: function(){
|
156 |
+
|
157 |
+
this.rows = this.$input().attr('rows');
|
158 |
+
this.mode = this.$control().data('mode');
|
159 |
+
this.lines = this.$control().data('lines');
|
160 |
+
this.indentUnit = this.$control().data('indent_unit');
|
161 |
+
|
162 |
+
this.editor = wp.CodeMirror.fromTextArea(this.input(), {
|
163 |
+
lineNumbers: this.lines,
|
164 |
+
lineWrapping: true,
|
165 |
+
styleActiveLine: false,
|
166 |
+
continueComments: true,
|
167 |
+
indentUnit: this.indentUnit,
|
168 |
+
tabSize: 1,
|
169 |
+
indentWithTabs: true,
|
170 |
+
mode: this.mode,
|
171 |
+
//mode: 'htmlmixed',
|
172 |
+
extraKeys: {
|
173 |
+
Tab: function(cm){
|
174 |
+
cm.execCommand("indentMore")
|
175 |
+
},
|
176 |
+
"Shift-Tab": function(cm){
|
177 |
+
cm.execCommand("indentLess")
|
178 |
+
},
|
179 |
+
},
|
180 |
+
});
|
181 |
+
|
182 |
+
if(this.rows){
|
183 |
+
|
184 |
+
this.editor.getScrollerElement().style.minHeight = this.rows * 22 + 'px';
|
185 |
+
|
186 |
+
this.editor.refresh();
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
+
field = this;
|
191 |
+
|
192 |
+
this.editor.on('change', function(){
|
193 |
+
|
194 |
+
field.editor.save();
|
195 |
+
|
196 |
+
});
|
197 |
+
|
198 |
+
},
|
199 |
+
|
200 |
+
onShow: function(){
|
201 |
+
|
202 |
+
if(this.editor){
|
203 |
+
|
204 |
+
this.editor.refresh();
|
205 |
+
|
206 |
+
}
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
});
|
211 |
+
|
212 |
+
acf.registerFieldType(CodeEditor);
|
213 |
+
|
214 |
+
|
215 |
/**
|
216 |
* Field: Textarea
|
217 |
*/
|
631 |
|
632 |
acf.registerFieldType(Column);
|
633 |
|
634 |
+
acf.addFilter('select2_ajax_data', function(ajaxData, data, $el, field, select){
|
635 |
+
|
636 |
+
if(ajaxData.action !== 'acf/fields/acfe_field_taxonomy_allow_terms/query')
|
637 |
+
return ajaxData;
|
638 |
+
|
639 |
+
// Taxonomies
|
640 |
+
var $taxonomies = $el.closest('.acf-field-settings').find('> .acf-field-setting-taxonomy > .acf-input > select > option:selected');
|
641 |
+
|
642 |
+
var tax = [];
|
643 |
+
|
644 |
+
$taxonomies.each(function(){
|
645 |
+
tax.push($(this).val());
|
646 |
+
});
|
647 |
+
|
648 |
+
ajaxData.taxonomies = tax;
|
649 |
+
|
650 |
+
// Terms level
|
651 |
+
var $level = $el.closest('.acf-field-settings').find('> .acf-field-setting-allow_terms > .acf-input input[type="number"]');
|
652 |
+
|
653 |
+
ajaxData.level = $level.val();
|
654 |
+
|
655 |
+
return ajaxData;
|
656 |
+
|
657 |
+
});
|
658 |
+
|
659 |
var acfe_form_map_fields = function(field){
|
660 |
|
661 |
var name = field.get('name');
|
assets/acf-extended-form.js
CHANGED
@@ -64,7 +64,30 @@
|
|
64 |
// Move below
|
65 |
if(errors_position && errors_position === 'below'){
|
66 |
|
67 |
-
field.$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
}
|
70 |
|
64 |
// Move below
|
65 |
if(errors_position && errors_position === 'below'){
|
66 |
|
67 |
+
if(field.$control().length){
|
68 |
+
|
69 |
+
field.$el.find('.acf-notice.-error').insertAfter(field.$control());
|
70 |
+
|
71 |
+
}else if(field.$input().length){
|
72 |
+
|
73 |
+
field.$el.find('.acf-notice.-error').insertAfter(field.$input());
|
74 |
+
|
75 |
+
}
|
76 |
+
|
77 |
+
var $selector = false;
|
78 |
+
|
79 |
+
if(field.$control().length){
|
80 |
+
|
81 |
+
$selector = field.$control();
|
82 |
+
|
83 |
+
}else if(field.$input().length){
|
84 |
+
|
85 |
+
$selector = field.$input();
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
if($selector)
|
90 |
+
field.$el.find('.acf-notice.-error').insertAfter($selector);
|
91 |
|
92 |
}
|
93 |
|
assets/acf-extended.css
CHANGED
@@ -1,144 +1,125 @@
|
|
1 |
/*
|
2 |
-
*
|
3 |
*/
|
4 |
-
.
|
5 |
-
|
6 |
-
.wrap .acfe-dt-admin-config,
|
7 |
-
.wrap .acfe-dt-admin-config:active{
|
8 |
-
padding-left:4px;
|
9 |
-
padding-right:4px;
|
10 |
-
}
|
11 |
-
|
12 |
-
.wrap .acfe-dpt-admin-config span,
|
13 |
-
.wrap .acfe-dt-admin-config span{
|
14 |
-
font-size: 16px;
|
15 |
-
vertical-align: text-top;
|
16 |
-
color:#444;
|
17 |
}
|
18 |
|
19 |
-
.
|
20 |
-
|
21 |
-
color:#fff;
|
22 |
}
|
23 |
|
24 |
/*
|
25 |
-
*
|
26 |
*/
|
27 |
-
|
28 |
-
|
29 |
}
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
*/
|
34 |
-
body.post-type-acfe-dt #minor-publishing{
|
35 |
-
display:none;
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
* ACFE: Dynamic Options Page
|
40 |
-
*/
|
41 |
-
body.post-type-acfe-dop #minor-publishing{
|
42 |
display:none;
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
47 |
*/
|
48 |
-
|
49 |
-
|
|
|
50 |
}
|
51 |
|
52 |
-
/*
|
53 |
-
* ACFE:
|
54 |
*/
|
55 |
-
.acf-field.acf-
|
56 |
-
|
|
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
*/
|
62 |
-
.acfe-postbox.acfe-postbox-no-handle h2.hndle{
|
63 |
-
cursor:initial;
|
64 |
}
|
65 |
|
66 |
-
.acfe-
|
67 |
-
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
/*
|
71 |
-
* ACF
|
72 |
*/
|
73 |
-
.
|
74 |
-
|
|
|
75 |
}
|
76 |
|
77 |
-
.
|
78 |
-
|
|
|
79 |
}
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
.acf-fields.-left > .acf-field > .acf-label{
|
85 |
-
min-height:1px;
|
86 |
}
|
87 |
|
88 |
-
.
|
89 |
-
|
90 |
-
|
91 |
}
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
*/
|
96 |
-
.acf-fields.-left > .acf-field.acfe-no-label > .acf-label{
|
97 |
-
margin:0;
|
98 |
-
display:block;
|
99 |
}
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
*/
|
104 |
-
.acf-field-textarea[data-acfe-textarea-code="1"] > .acf-input > textarea{
|
105 |
-
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
106 |
-
font-size: 1em;
|
107 |
}
|
108 |
|
109 |
/*
|
110 |
* ACF Field: Group
|
111 |
*/
|
112 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-block:not([data-acfe-group-modal="1"]) > .acf-input,
|
113 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-row:not([data-acfe-group-modal="1"]) > .acf-input{
|
114 |
margin-left: -12px;
|
115 |
margin-right: -12px;
|
116 |
margin-bottom: -15px;
|
117 |
}
|
118 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input,
|
119 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input{
|
120 |
margin-top: -15px;
|
121 |
}
|
122 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-no-label > .acf-input > .acf-fields{
|
123 |
border-width:0;
|
124 |
}
|
125 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-row > .acf-input > .acf-fields{
|
126 |
border-left-width:0;
|
127 |
border-right-width:0;
|
128 |
border-bottom-width:0;
|
129 |
}
|
130 |
-
.acf-fields > .acf-field-group.acfe-field-group-layout-block > .acf-input > .acf-fields{
|
131 |
border-width:0;
|
132 |
}
|
133 |
|
134 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-row > .acf-input{
|
135 |
margin:0;
|
136 |
}
|
137 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-row > .acf-input > .acf-fields{
|
138 |
border-width:1px;
|
139 |
}
|
140 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-block:not([data-acfe-group-modal="1"]) > .acf-input,
|
141 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-table:not([data-acfe-group-modal="1"]) > .acf-input{
|
142 |
padding:0;
|
143 |
padding-left:1px;
|
144 |
margin-top: -15px;
|
@@ -146,8 +127,8 @@ body.post-type-acfe-dbt #minor-publishing{
|
|
146 |
margin-left: 0;
|
147 |
margin-right: 0;
|
148 |
}
|
149 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-block > .acf-input > .acf-fields,
|
150 |
-
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-table > .acf-input > .acf-table{
|
151 |
border-width:0;
|
152 |
}
|
153 |
|
@@ -156,57 +137,57 @@ body.post-type-acfe-dbt #minor-publishing{
|
|
156 |
border-width:0;
|
157 |
}
|
158 |
|
159 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block > .acf-input,
|
160 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row > .acf-input,
|
161 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table > .acf-table{
|
162 |
margin:0;
|
163 |
}
|
164 |
|
165 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block > .acf-input > .acf-fields,
|
166 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row > .acf-input > .acf-fields,
|
167 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table > .acf-input > .acf-table{
|
168 |
border-width:1px;
|
169 |
}
|
170 |
|
171 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block > .acf-input,
|
172 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row > .acf-input,
|
173 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table > .acf-input{
|
174 |
padding:0 12px;
|
175 |
}
|
176 |
|
177 |
/*
|
178 |
* ACF Field: Clone
|
179 |
*/
|
180 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block:not([data-acfe-clone-modal="1"]) > .acf-input,
|
181 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row:not([data-acfe-clone-modal="1"]) > .acf-input{
|
182 |
margin-left: -12px;
|
183 |
margin-right: -12px;
|
184 |
margin-bottom: -15px;
|
185 |
}
|
186 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-no-label:not([data-acfe-clone-modal="1"]) > .acf-input,
|
187 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label:not([data-acfe-clone-modal="1"]) > .acf-input{
|
188 |
margin-top: -15px;
|
189 |
}
|
190 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label > .acf-input > .acf-fields{
|
191 |
border-width:0;
|
192 |
}
|
193 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row > .acf-input > .acf-fields{
|
194 |
border-left-width:0;
|
195 |
border-right-width:0;
|
196 |
border-bottom-width:0;
|
197 |
}
|
198 |
-
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block > .acf-input > .acf-fields{
|
199 |
border-width:0;
|
200 |
}
|
201 |
|
202 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row > .acf-input{
|
203 |
margin:0;
|
204 |
}
|
205 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row > .acf-input > .acf-fields{
|
206 |
border-width:1px;
|
207 |
}
|
208 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block:not([data-acfe-clone-modal="1"]) > .acf-input,
|
209 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table:not([data-acfe-clone-modal="1"]) > .acf-input{
|
210 |
padding:0;
|
211 |
padding-left:1px;
|
212 |
margin-top: -15px;
|
@@ -214,8 +195,8 @@ body.post-type-acfe-dbt #minor-publishing{
|
|
214 |
margin-left: 0;
|
215 |
margin-right: 0;
|
216 |
}
|
217 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block > .acf-input > .acf-fields,
|
218 |
-
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table > .acf-input > .acf-table{
|
219 |
border-width:0;
|
220 |
}
|
221 |
|
@@ -224,151 +205,27 @@ body.post-type-acfe-dbt #minor-publishing{
|
|
224 |
border-width:0;
|
225 |
}
|
226 |
|
227 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block > .acf-input,
|
228 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row > .acf-input,
|
229 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table > .acf-table{
|
230 |
margin:0;
|
231 |
}
|
232 |
|
233 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block > .acf-input > .acf-fields,
|
234 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row > .acf-input > .acf-fields,
|
235 |
-
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table > .acf-input > .acf-table{
|
236 |
border-width:1px;
|
237 |
}
|
238 |
|
239 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block > .acf-input,
|
240 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row > .acf-input,
|
241 |
-
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table > .acf-input{
|
242 |
padding:0 12px;
|
243 |
}
|
244 |
|
245 |
-
/*
|
246 |
-
* ACF Field: Select2 Fix
|
247 |
-
*/
|
248 |
-
.select2-container .select2-selection{
|
249 |
-
border-color: #dfdfdf !important;
|
250 |
-
border-radius:0 !important;
|
251 |
-
}
|
252 |
-
|
253 |
-
.select2-container .select2-selection__choice{
|
254 |
-
border-color: #dfdfdf !important;
|
255 |
-
border-radius:0 !important;
|
256 |
-
}
|
257 |
-
|
258 |
-
.select2-dropdown{
|
259 |
-
border-color: #dfdfdf !important;
|
260 |
-
border-radius:0 !important;
|
261 |
-
}
|
262 |
-
|
263 |
-
.select2-container .select2-selection--single .select2-selection__arrow,
|
264 |
-
.select2-container .select2-selection--single{
|
265 |
-
height: 32px !important;
|
266 |
-
}
|
267 |
-
|
268 |
-
.select2-container .select2-selection--single .select2-selection__rendered{
|
269 |
-
line-height: 31px !important;
|
270 |
-
}
|
271 |
-
|
272 |
-
.select2-container .select2-selection--single .select2-selection__clear{
|
273 |
-
line-height: 30px;
|
274 |
-
}
|
275 |
-
|
276 |
-
/*
|
277 |
-
* Gutenberg: Fix metaboxes
|
278 |
-
*/
|
279 |
-
.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{
|
280 |
-
margin:10px 10px 0;
|
281 |
-
}
|
282 |
-
|
283 |
-
.edit-post-layout__metaboxes:not(:empty) {
|
284 |
-
background:#f3f4f5;
|
285 |
-
}
|
286 |
-
|
287 |
-
.edit-post-layout__metaboxes .edit-post-meta-boxes-area .postbox{
|
288 |
-
margin-bottom:10px;
|
289 |
-
}
|
290 |
-
|
291 |
-
/* Firefox fix only */
|
292 |
-
@supports (-moz-appearance:meterbar){
|
293 |
-
.edit-post-layout__metaboxes .postbox{
|
294 |
-
box-shadow:0 1px 1px 1px rgba(0,0,0,.04);
|
295 |
-
}
|
296 |
-
}
|
297 |
-
|
298 |
-
/*
|
299 |
-
* ACF Tools
|
300 |
-
*/
|
301 |
-
#acf-admin-tool-acfe_tool_dbt_export ul,
|
302 |
-
#acf-admin-tool-acfe_tool_dpt_export ul,
|
303 |
-
#acf-admin-tool-acfe_tool_dt_export ul,
|
304 |
-
#acf-admin-tool-acfe_tool_dop_export ul{
|
305 |
-
column-width: 200px;
|
306 |
-
}
|
307 |
-
|
308 |
-
.acf-meta-box-wrap.-grid #acf-admin-tool-acfe-fg-local{
|
309 |
-
display:none;
|
310 |
-
}
|
311 |
-
|
312 |
-
/*
|
313 |
-
* ACFE WP Options
|
314 |
-
*/
|
315 |
-
.settings_page_acfe-options .column-option_id{
|
316 |
-
width:65px;
|
317 |
-
}
|
318 |
-
|
319 |
-
.settings_page_acfe-options .column-option_name{
|
320 |
-
width:435px;
|
321 |
-
}
|
322 |
-
|
323 |
-
.settings_page_acfe-options .column-autoload{
|
324 |
-
width:100px;
|
325 |
-
text-align:center;
|
326 |
-
}
|
327 |
-
|
328 |
/*
|
329 |
* ACFE Form
|
330 |
*/
|
331 |
-
.acf-field[data-name="acfe_form_post_save_post_title_custom"],
|
332 |
-
.acf-field[data-name="acfe_form_post_save_post_name_custom"],
|
333 |
-
.acf-field[data-name="acfe_form_post_save_post_content_custom"],
|
334 |
-
|
335 |
-
.acf-field[data-name="acfe_form_term_save_name_custom"],
|
336 |
-
.acf-field[data-name="acfe_form_term_save_slug_custom"],
|
337 |
-
.acf-field[data-name="acfe_form_term_save_description_custom"],
|
338 |
-
|
339 |
-
.acf-field[data-name="acfe_form_user_save_email_custom"],
|
340 |
-
.acf-field[data-name="acfe_form_user_save_username_custom"],
|
341 |
-
.acf-field[data-name="acfe_form_user_save_password_custom"],
|
342 |
-
.acf-field[data-name="acfe_form_user_save_first_name_custom"],
|
343 |
-
.acf-field[data-name="acfe_form_user_save_last_name_custom"],
|
344 |
-
.acf-field[data-name="acfe_form_user_save_nickname_custom"],
|
345 |
-
.acf-field[data-name="acfe_form_user_save_display_name_custom"],
|
346 |
-
.acf-field[data-name="acfe_form_user_save_website_custom"],
|
347 |
-
.acf-field[data-name="acfe_form_user_save_description_custom"]{
|
348 |
-
border-top:0;
|
349 |
-
padding-top:0;
|
350 |
-
}
|
351 |
-
|
352 |
-
.acf-field.acf-field-acfe-form-attributes > .acf-input > .acf-fields > .acf-field{
|
353 |
-
border-left-width:0;
|
354 |
-
}
|
355 |
-
|
356 |
-
.acf-field.acf-field-acfe-form-fields-attributes > .acf-input > .acf-fields > .acf-field{
|
357 |
-
border-left-width:0;
|
358 |
-
}
|
359 |
-
|
360 |
-
.acf-field-repeater.acf-field-acfe-form-email-files > .acf-input > .acf-repeater > .acf-actions{
|
361 |
-
text-align:left;
|
362 |
-
}
|
363 |
-
|
364 |
-
.acf-field-repeater.acf-field-acfe-form-email-files > .acf-input > .acf-repeater > .acf-actions > .acf-button{
|
365 |
-
color: #555;
|
366 |
-
border-color: #ccc;
|
367 |
-
background: #f7f7f7;
|
368 |
-
box-shadow: 0 1px 0 #ccc;
|
369 |
-
text-shadow:none;
|
370 |
-
}
|
371 |
-
|
372 |
form.acfe-form.is-invalid[data-hide-error="1"] > .acf-error-message.-dismiss{
|
373 |
display:none;
|
374 |
}
|
@@ -377,36 +234,6 @@ form.acfe-form.is-invalid[data-errors-position="below"] .acf-field .acf-notice{
|
|
377 |
margin:15px 0 0;
|
378 |
}
|
379 |
|
380 |
-
/*
|
381 |
-
* ACFE General
|
382 |
-
*/
|
383 |
-
pre{
|
384 |
-
display: block;
|
385 |
-
padding: 9.5px;
|
386 |
-
margin: 0;
|
387 |
-
font-size: 13px;
|
388 |
-
line-height: 1.42857143;
|
389 |
-
color: #333;
|
390 |
-
word-break: break-all;
|
391 |
-
word-wrap: break-word;
|
392 |
-
background-color: #f5f5f5;
|
393 |
-
border: 1px solid #ccc;
|
394 |
-
border-radius: 1px;
|
395 |
-
white-space: pre-wrap;
|
396 |
-
overflow: auto;
|
397 |
-
}
|
398 |
-
|
399 |
-
code, kbd, pre, samp{
|
400 |
-
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
401 |
-
font-size: 1em;
|
402 |
-
}
|
403 |
-
|
404 |
-
.postbox#acfe-wp-custom-fields > .inside,
|
405 |
-
.postbox#acfe-acf-custom-fields > .inside{
|
406 |
-
padding:0;
|
407 |
-
margin:0;
|
408 |
-
}
|
409 |
-
|
410 |
/*
|
411 |
* ACFE Column
|
412 |
*/
|
1 |
/*
|
2 |
+
* ACF: Field fix
|
3 |
*/
|
4 |
+
.acf-field .acf-label label{
|
5 |
+
font-weight:600 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
}
|
7 |
|
8 |
+
.acf-field p.description{
|
9 |
+
word-break: break-word;
|
|
|
10 |
}
|
11 |
|
12 |
/*
|
13 |
+
* ACF: Field fix empty label on field group label placement left
|
14 |
*/
|
15 |
+
.acf-fields.-left > .acf-field > .acf-label{
|
16 |
+
min-height:1px;
|
17 |
}
|
18 |
|
19 |
+
.acf-field.acfe-no-label > .acf-label{
|
20 |
+
margin:0;
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
+
.acf-field.acfe-no-label > .acf-label > label{
|
|
|
|
|
|
|
24 |
display:none;
|
25 |
}
|
26 |
|
27 |
+
.acf-field.acfe-no-label > .acf-label > p.description{
|
28 |
+
margin-bottom:10px;
|
29 |
+
}
|
30 |
+
|
31 |
+
/*
|
32 |
+
* ACF Field: Textarea
|
33 |
*/
|
34 |
+
.acf-field-textarea[data-acfe-textarea-code="1"] > .acf-input > textarea{
|
35 |
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
36 |
+
font-size: 1em;
|
37 |
}
|
38 |
|
39 |
+
/*
|
40 |
+
* ACFE Field: Code Editor
|
41 |
*/
|
42 |
+
.acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap{
|
43 |
+
border:1px solid #dfdfdf;
|
44 |
+
height: auto;
|
45 |
}
|
46 |
|
47 |
+
.acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-activeline-background{
|
48 |
+
background:#f9f9f9;
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
+
.acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-selected{
|
52 |
+
background:#f0f0f0 !important;
|
53 |
+
}
|
54 |
+
|
55 |
+
.acf-field-acfe-code-editor > .acf-input > .acf-input-wrap > .CodeMirror-wrap .CodeMirror-gutters{
|
56 |
+
background:#f9f9f9;
|
57 |
}
|
58 |
|
59 |
/*
|
60 |
+
* ACF Field: Select2 Fix
|
61 |
*/
|
62 |
+
.select2-container .select2-selection{
|
63 |
+
border-color: #dfdfdf !important;
|
64 |
+
border-radius:0 !important;
|
65 |
}
|
66 |
|
67 |
+
.select2-container .select2-selection__choice{
|
68 |
+
border-color: #dfdfdf !important;
|
69 |
+
border-radius:0 !important;
|
70 |
}
|
71 |
|
72 |
+
.select2-dropdown{
|
73 |
+
border-color: #dfdfdf !important;
|
74 |
+
border-radius:0 !important;
|
|
|
|
|
75 |
}
|
76 |
|
77 |
+
.select2-container .select2-selection--single .select2-selection__arrow,
|
78 |
+
.select2-container .select2-selection--single{
|
79 |
+
height: 32px !important;
|
80 |
}
|
81 |
|
82 |
+
.select2-container .select2-selection--single .select2-selection__rendered{
|
83 |
+
line-height: 31px !important;
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
+
|
86 |
+
.select2-container .select2-selection--single .select2-selection__clear{
|
87 |
+
line-height: 30px;
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
/*
|
91 |
* ACF Field: Group
|
92 |
*/
|
93 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input,
|
94 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input{
|
95 |
margin-left: -12px;
|
96 |
margin-right: -12px;
|
97 |
margin-bottom: -15px;
|
98 |
}
|
99 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input,
|
100 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style.acfe-no-label:not([data-acfe-group-modal="1"]) > .acf-input{
|
101 |
margin-top: -15px;
|
102 |
}
|
103 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style.acfe-no-label > .acf-input > .acf-fields{
|
104 |
border-width:0;
|
105 |
}
|
106 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
|
107 |
border-left-width:0;
|
108 |
border-right-width:0;
|
109 |
border-bottom-width:0;
|
110 |
}
|
111 |
+
.acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields{
|
112 |
border-width:0;
|
113 |
}
|
114 |
|
115 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input{
|
116 |
margin:0;
|
117 |
}
|
118 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
|
119 |
border-width:1px;
|
120 |
}
|
121 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input,
|
122 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style:not([data-acfe-group-modal="1"]) > .acf-input{
|
123 |
padding:0;
|
124 |
padding-left:1px;
|
125 |
margin-top: -15px;
|
127 |
margin-left: 0;
|
128 |
margin-right: 0;
|
129 |
}
|
130 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
|
131 |
+
.acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input > .acf-table{
|
132 |
border-width:0;
|
133 |
}
|
134 |
|
137 |
border-width:0;
|
138 |
}
|
139 |
|
140 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input,
|
141 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input,
|
142 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-table{
|
143 |
margin:0;
|
144 |
}
|
145 |
|
146 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
|
147 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input > .acf-fields,
|
148 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input > .acf-table{
|
149 |
border-width:1px;
|
150 |
}
|
151 |
|
152 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-block.acfe-seemless-style > .acf-input,
|
153 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-row.acfe-seemless-style > .acf-input,
|
154 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-group.acfe-field-group-layout-table.acfe-seemless-style > .acf-input{
|
155 |
padding:0 12px;
|
156 |
}
|
157 |
|
158 |
/*
|
159 |
* ACF Field: Clone
|
160 |
*/
|
161 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
|
162 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
|
163 |
margin-left: -12px;
|
164 |
margin-right: -12px;
|
165 |
margin-bottom: -15px;
|
166 |
}
|
167 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-no-label.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
|
168 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
|
169 |
margin-top: -15px;
|
170 |
}
|
171 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-no-label.acfe-seemless-style > .acf-input > .acf-fields{
|
172 |
border-width:0;
|
173 |
}
|
174 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
|
175 |
border-left-width:0;
|
176 |
border-right-width:0;
|
177 |
border-bottom-width:0;
|
178 |
}
|
179 |
+
.acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields{
|
180 |
border-width:0;
|
181 |
}
|
182 |
|
183 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input{
|
184 |
margin:0;
|
185 |
}
|
186 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields{
|
187 |
border-width:1px;
|
188 |
}
|
189 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input,
|
190 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style:not([data-acfe-clone-modal="1"]) > .acf-input{
|
191 |
padding:0;
|
192 |
padding-left:1px;
|
193 |
margin-top: -15px;
|
195 |
margin-left: 0;
|
196 |
margin-right: 0;
|
197 |
}
|
198 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
|
199 |
+
.acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input > .acf-table{
|
200 |
border-width:0;
|
201 |
}
|
202 |
|
205 |
border-width:0;
|
206 |
}
|
207 |
|
208 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input,
|
209 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input,
|
210 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-table{
|
211 |
margin:0;
|
212 |
}
|
213 |
|
214 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input > .acf-fields,
|
215 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input > .acf-fields,
|
216 |
+
.acf-postbox.seamless > .acf-fields > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input > .acf-table{
|
217 |
border-width:1px;
|
218 |
}
|
219 |
|
220 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-block.acfe-seemless-style > .acf-input,
|
221 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-row.acfe-seemless-style > .acf-input,
|
222 |
+
.acf-postbox.seamless > .acf-fields.-left > .acf-field-clone.acfe-field-clone-layout-table.acfe-seemless-style > .acf-input{
|
223 |
padding:0 12px;
|
224 |
}
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
/*
|
227 |
* ACFE Form
|
228 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
form.acfe-form.is-invalid[data-hide-error="1"] > .acf-error-message.-dismiss{
|
230 |
display:none;
|
231 |
}
|
234 |
margin:15px 0 0;
|
235 |
}
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
/*
|
238 |
* ACFE Column
|
239 |
*/
|
includes/admin/settings.php
CHANGED
@@ -289,7 +289,7 @@ function acfe_admin_settings_html(){
|
|
289 |
),
|
290 |
array(
|
291 |
'name' => 'acfe/modules/taxonomies',
|
292 |
-
'label' => 'Module:
|
293 |
'value' => '<code>' . (acf_get_setting('acfe/modules/taxonomies', true) ? __('True'): __('False')) . '</code>',
|
294 |
'description' => 'Show/hide the Taxonomies enhancements module. Defaults to true'
|
295 |
),
|
289 |
),
|
290 |
array(
|
291 |
'name' => 'acfe/modules/taxonomies',
|
292 |
+
'label' => 'Module: Taxonomies Enhancements',
|
293 |
'value' => '<code>' . (acf_get_setting('acfe/modules/taxonomies', true) ? __('True'): __('False')) . '</code>',
|
294 |
'description' => 'Show/hide the Taxonomies enhancements module. Defaults to true'
|
295 |
),
|
includes/core/enqueue.php
CHANGED
@@ -16,6 +16,7 @@ function acfe_enqueue_admin_scripts(){
|
|
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 |
|
20 |
// Better Taxonomies
|
21 |
if(acf_get_setting('acfe/modules/taxonomies')){
|
@@ -23,7 +24,7 @@ function acfe_enqueue_admin_scripts(){
|
|
23 |
wp_enqueue_style('acf-extended-taxonomies', plugins_url('assets/acf-extended-taxonomies.css', ACFE_FILE), false, ACFE_VERSION);
|
24 |
|
25 |
}
|
26 |
-
|
27 |
// ACF Extended: Field Groups only
|
28 |
if(acf_is_screen(array('edit-acf-field-group', 'acf-field-group'))){
|
29 |
|
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')){
|
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 |
|
includes/core/helpers.php
CHANGED
@@ -597,7 +597,7 @@ if(function_exists('acf_add_filter_variations')){
|
|
597 |
|
598 |
function acfe_form_is_admin(){
|
599 |
|
600 |
-
if((is_admin() && !wp_doing_ajax()) || (is_admin() && wp_doing_ajax() && acf_maybe_get_POST('_acf_screen') !== 'acfe_form'))
|
601 |
return true;
|
602 |
|
603 |
return false;
|
@@ -606,13 +606,27 @@ function acfe_form_is_admin(){
|
|
606 |
|
607 |
function acfe_form_is_front(){
|
608 |
|
609 |
-
if(!is_admin() || (is_admin() && wp_doing_ajax() && acf_maybe_get_POST('_acf_screen') === 'acfe_form'))
|
610 |
return true;
|
611 |
|
612 |
return false;
|
613 |
|
614 |
}
|
615 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
function acfe_array_insert_before($key, array &$array, $new_key, $new_value){
|
617 |
|
618 |
if(!array_key_exists($key, $array))
|
@@ -744,4 +758,28 @@ function acfe_get_taxonomy_terms_ids($taxonomies = array()){
|
|
744 |
// return
|
745 |
return $r;
|
746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
}
|
597 |
|
598 |
function acfe_form_is_admin(){
|
599 |
|
600 |
+
if((is_admin() && !wp_doing_ajax()) || (is_admin() && wp_doing_ajax() && acf_maybe_get_POST('_acf_screen') !== 'acfe_form' && acf_maybe_get_POST('_acf_screen') !== 'acf_form'))
|
601 |
return true;
|
602 |
|
603 |
return false;
|
606 |
|
607 |
function acfe_form_is_front(){
|
608 |
|
609 |
+
if(!is_admin() || (is_admin() && wp_doing_ajax() && (acf_maybe_get_POST('_acf_screen') === 'acfe_form' || acf_maybe_get_POST('_acf_screen') === 'acf_form')))
|
610 |
return true;
|
611 |
|
612 |
return false;
|
613 |
|
614 |
}
|
615 |
|
616 |
+
function acfe_form_decrypt_args(){
|
617 |
+
|
618 |
+
if(!acf_maybe_get_POST('_acf_form'))
|
619 |
+
return false;
|
620 |
+
|
621 |
+
$form = json_decode(acf_decrypt($_POST['_acf_form']), true);
|
622 |
+
|
623 |
+
if(empty($form))
|
624 |
+
return false;
|
625 |
+
|
626 |
+
return $form;
|
627 |
+
|
628 |
+
}
|
629 |
+
|
630 |
function acfe_array_insert_before($key, array &$array, $new_key, $new_value){
|
631 |
|
632 |
if(!array_key_exists($key, $array))
|
758 |
// return
|
759 |
return $r;
|
760 |
|
761 |
+
}
|
762 |
+
|
763 |
+
function acfe_get_term_level($term, $taxonomy){
|
764 |
+
|
765 |
+
$ancestors = get_ancestors($term, $taxonomy);
|
766 |
+
|
767 |
+
return count($ancestors) + 1;
|
768 |
+
|
769 |
+
}
|
770 |
+
|
771 |
+
function acfe_number_suffix($num){
|
772 |
+
|
773 |
+
if(!in_array(($num % 100), array(11,12,13))){
|
774 |
+
|
775 |
+
switch($num % 10){
|
776 |
+
case 1: return $num . 'st';
|
777 |
+
case 2: return $num . 'nd';
|
778 |
+
case 3: return $num . 'rd';
|
779 |
+
}
|
780 |
+
|
781 |
+
}
|
782 |
+
|
783 |
+
return $num . 'th';
|
784 |
+
|
785 |
}
|
includes/field-groups/field-groups.php
CHANGED
@@ -111,25 +111,31 @@ function acfe_field_groups_column_html($column, $post_id){
|
|
111 |
|
112 |
$field_group = acf_get_field_group($post_id);
|
113 |
|
|
|
|
|
114 |
// ACF Extended
|
115 |
if(strpos($post_id, 'group_acfe_') === 0){
|
116 |
|
117 |
-
|
118 |
|
119 |
}
|
120 |
|
121 |
// Advanced Forms
|
122 |
elseif($post_id === 'group_form_settings' || $post_id === 'group_entry_data'){
|
123 |
|
124 |
-
|
125 |
|
126 |
}
|
127 |
|
128 |
else{
|
129 |
|
130 |
-
|
131 |
|
132 |
}
|
|
|
|
|
|
|
|
|
133 |
|
134 |
}
|
135 |
|
111 |
|
112 |
$field_group = acf_get_field_group($post_id);
|
113 |
|
114 |
+
$source = false;
|
115 |
+
|
116 |
// ACF Extended
|
117 |
if(strpos($post_id, 'group_acfe_') === 0){
|
118 |
|
119 |
+
$source = 'ACF Extended';
|
120 |
|
121 |
}
|
122 |
|
123 |
// Advanced Forms
|
124 |
elseif($post_id === 'group_form_settings' || $post_id === 'group_entry_data'){
|
125 |
|
126 |
+
$source = 'Advanced Forms';
|
127 |
|
128 |
}
|
129 |
|
130 |
else{
|
131 |
|
132 |
+
$source = '<span style="color:#aaa;">' . __('Unknown', 'acf') . '</span>';
|
133 |
|
134 |
}
|
135 |
+
|
136 |
+
$source = apply_filters('acfe/field_groups_third_party/source', $source, $post_id, $field_group);
|
137 |
+
|
138 |
+
echo $source;
|
139 |
|
140 |
}
|
141 |
|
includes/fields-settings/bidirectional.php
CHANGED
@@ -371,7 +371,7 @@ function acfe_bidirectional_update_value($value, $post_id, $field){
|
|
371 |
// Bail early if no difference
|
372 |
// if($old_values === $new_values)
|
373 |
// return $value;
|
374 |
-
|
375 |
// Values have been removed
|
376 |
if(!empty($old_values)){
|
377 |
foreach($old_values as $r_id){
|
@@ -396,6 +396,25 @@ function acfe_bidirectional_update_value($value, $post_id, $field){
|
|
396 |
}
|
397 |
}
|
398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
return $value;
|
400 |
|
401 |
}
|
371 |
// Bail early if no difference
|
372 |
// if($old_values === $new_values)
|
373 |
// return $value;
|
374 |
+
|
375 |
// Values have been removed
|
376 |
if(!empty($old_values)){
|
377 |
foreach($old_values as $r_id){
|
396 |
}
|
397 |
}
|
398 |
|
399 |
+
$force_update = false;
|
400 |
+
$force_update = apply_filters('acfe/bidirectional/force_update', $force_update, $field, $post_id);
|
401 |
+
$force_update = apply_filters('acfe/bidirectional/force_update/type=' . $field['type'], $force_update, $field, $post_id);
|
402 |
+
$force_update = apply_filters('acfe/bidirectional/force_update/name=' . $field['name'], $force_update, $field, $post_id);
|
403 |
+
$force_update = apply_filters('acfe/bidirectional/force_update/key=' . $field['key'], $force_update, $field, $post_id);
|
404 |
+
|
405 |
+
if($force_update){
|
406 |
+
|
407 |
+
// Force new values to be saved
|
408 |
+
if(!empty($new_values)){
|
409 |
+
foreach($new_values as $r_id){
|
410 |
+
|
411 |
+
acfe_bidirectional_relationship('add', $r_id, $field, $request['id']);
|
412 |
+
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
}
|
417 |
+
|
418 |
return $value;
|
419 |
|
420 |
}
|
includes/fields-settings/fields.php
CHANGED
@@ -3,6 +3,17 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
add_filter('acf/pre_render_fields', 'acfe_fields_wrapper_instructions', 10, 2);
|
7 |
function acfe_fields_wrapper_instructions($fields, $post_id){
|
8 |
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
add_filter('acf/field_wrapper_attributes', 'acfe_field_wrapper_attributes', 10, 2);
|
7 |
+
function acfe_field_wrapper_attributes($wrapper, $field){
|
8 |
+
|
9 |
+
$wrapper = apply_filters('acfe/field_wrapper_attributes/type=' . $field['type'], $wrapper, $field);
|
10 |
+
$wrapper = apply_filters('acfe/field_wrapper_attributes/name=' . $field['name'], $wrapper, $field);
|
11 |
+
$wrapper = apply_filters('acfe/field_wrapper_attributes/key=' . $field['key'], $wrapper, $field);
|
12 |
+
|
13 |
+
return $wrapper;
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
add_filter('acf/pre_render_fields', 'acfe_fields_wrapper_instructions', 10, 2);
|
18 |
function acfe_fields_wrapper_instructions($fields, $post_id){
|
19 |
|
includes/fields/field-advanced-link.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_advanced_link extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -312,4 +314,7 @@ function my_acf_advanced_link_fields($fields, $field, $value){
|
|
312 |
|
313 |
}
|
314 |
|
315 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_advanced_link')):
|
7 |
+
|
8 |
class acfe_field_advanced_link extends acf_field{
|
9 |
|
10 |
function __construct(){
|
314 |
|
315 |
}
|
316 |
|
317 |
+
// initialize
|
318 |
+
acf_register_field_type('acfe_field_advanced_link');
|
319 |
+
|
320 |
+
endif;
|
includes/fields/field-button.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_button extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -198,4 +200,7 @@ acf.addAction('acfe/fields/button/ajax_success', function(response, $el){
|
|
198 |
|
199 |
}
|
200 |
|
201 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_button')):
|
7 |
+
|
8 |
class acfe_field_button extends acf_field{
|
9 |
|
10 |
function __construct(){
|
200 |
|
201 |
}
|
202 |
|
203 |
+
// initialize
|
204 |
+
acf_register_field_type('acfe_field_button');
|
205 |
+
|
206 |
+
endif;
|
includes/fields/field-clone.php
CHANGED
@@ -6,6 +6,31 @@ if(!defined('ABSPATH'))
|
|
6 |
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' => __('Edition modal'),
|
11 |
'name' => 'acfe_clone_modal',
|
@@ -37,18 +62,15 @@ function acfe_field_clone_settings($field){
|
|
37 |
|
38 |
}
|
39 |
|
40 |
-
add_filter('
|
41 |
function acfe_field_clone_wrapper($wrapper, $field){
|
42 |
|
43 |
-
if($field
|
44 |
-
return $wrapper;
|
45 |
-
|
46 |
-
if(isset($field['acfe_clone_modal']) && !empty($field['acfe_clone_modal'])){
|
47 |
|
48 |
$wrapper['data-acfe-clone-modal'] = 1;
|
49 |
$wrapper['data-acfe-clone-modal-button'] = __('Edit', 'acf');
|
50 |
|
51 |
-
if(
|
52 |
|
53 |
$wrapper['data-acfe-clone-modal-button'] = $field['acfe_clone_modal_button'];
|
54 |
|
@@ -95,8 +117,17 @@ function acfe_field_clone_ajax_query($field_groups){
|
|
95 |
add_filter('acf/prepare_field/type=clone', 'acfe_field_clone_type_class', 99);
|
96 |
function acfe_field_clone_type_class($field){
|
97 |
|
98 |
-
if(acf_maybe_get($field, '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$field['wrapper']['class'] .= ' acfe-field-clone-layout-' . $field['layout'];
|
|
|
|
|
100 |
|
101 |
return $field;
|
102 |
|
6 |
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' => '',
|
16 |
+
'default_value' => false,
|
17 |
+
'ui' => true,
|
18 |
+
'conditional_logic' => array(
|
19 |
+
array(
|
20 |
+
array(
|
21 |
+
'field' => 'display',
|
22 |
+
'operator' => '==',
|
23 |
+
'value' => 'group',
|
24 |
+
),
|
25 |
+
array(
|
26 |
+
'field' => 'acfe_clone_modal',
|
27 |
+
'operator' => '!=',
|
28 |
+
'value' => '1',
|
29 |
+
)
|
30 |
+
)
|
31 |
+
)
|
32 |
+
));
|
33 |
+
|
34 |
acf_render_field_setting($field, array(
|
35 |
'label' => __('Edition modal'),
|
36 |
'name' => 'acfe_clone_modal',
|
62 |
|
63 |
}
|
64 |
|
65 |
+
add_filter('acfe/field_wrapper_attributes/type=clone', 'acfe_field_clone_wrapper', 10, 2);
|
66 |
function acfe_field_clone_wrapper($wrapper, $field){
|
67 |
|
68 |
+
if(acf_maybe_get($field, 'acfe_clone_modal')){
|
|
|
|
|
|
|
69 |
|
70 |
$wrapper['data-acfe-clone-modal'] = 1;
|
71 |
$wrapper['data-acfe-clone-modal-button'] = __('Edit', 'acf');
|
72 |
|
73 |
+
if(acf_maybe_get($field, 'acfe_clone_modal_button')){
|
74 |
|
75 |
$wrapper['data-acfe-clone-modal-button'] = $field['acfe_clone_modal_button'];
|
76 |
|
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 |
+
|
126 |
+
if(acf_maybe_get($field, 'layout')){
|
127 |
+
|
128 |
$field['wrapper']['class'] .= ' acfe-field-clone-layout-' . $field['layout'];
|
129 |
+
|
130 |
+
}
|
131 |
|
132 |
return $field;
|
133 |
|
includes/fields/field-code-editor.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
if(version_compare($GLOBALS['wp_version'], '4.9', '<'))
|
7 |
+
return;
|
8 |
+
|
9 |
+
if(!class_exists('acfe_field_code_editor')):
|
10 |
+
|
11 |
+
class acfe_field_code_editor extends acf_field{
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
|
15 |
+
$this->name = 'acfe_code_editor';
|
16 |
+
$this->label = __('Code Editor', 'acfe');
|
17 |
+
$this->category = 'content';
|
18 |
+
$this->defaults = array(
|
19 |
+
'default_value' => '',
|
20 |
+
'placeholder' => '',
|
21 |
+
'mode' => 'text/html',
|
22 |
+
'lines' => true,
|
23 |
+
'indent_unit' => 4,
|
24 |
+
'maxlength' => '',
|
25 |
+
'rows' => ''
|
26 |
+
);
|
27 |
+
|
28 |
+
$this->textarea = acf_get_field_type('textarea');
|
29 |
+
|
30 |
+
parent::__construct();
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
function render_field($field){
|
35 |
+
|
36 |
+
$wrapper = array(
|
37 |
+
'class' => 'acf-input-wrap acfe-field-code-editor',
|
38 |
+
'data-mode' => $field['mode'],
|
39 |
+
'data-lines' => $field['lines'],
|
40 |
+
'data-indent_unit' => $field['indent_unit'],
|
41 |
+
);
|
42 |
+
|
43 |
+
$field['type'] = 'textarea';
|
44 |
+
|
45 |
+
?>
|
46 |
+
<div <?php acf_esc_attr_e($wrapper); ?>>
|
47 |
+
<?php $this->textarea->render_field($field); ?>
|
48 |
+
</div>
|
49 |
+
<?php
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
function render_field_settings($field){
|
54 |
+
|
55 |
+
// default_value
|
56 |
+
acf_render_field_setting($field, array(
|
57 |
+
'label' => __('Default Value','acf'),
|
58 |
+
'instructions' => __('Appears when creating a new post','acf'),
|
59 |
+
'type' => 'acfe_code_editor',
|
60 |
+
'name' => 'default_value',
|
61 |
+
));
|
62 |
+
|
63 |
+
// placeholder
|
64 |
+
acf_render_field_setting($field, array(
|
65 |
+
'label' => __('Placeholder','acf'),
|
66 |
+
'instructions' => __('Appears within the input','acf'),
|
67 |
+
'type' => 'acfe_code_editor',
|
68 |
+
'name' => 'placeholder',
|
69 |
+
));
|
70 |
+
|
71 |
+
// Mode
|
72 |
+
acf_render_field_setting($field, array(
|
73 |
+
'label' => __('Editor mode','acf'),
|
74 |
+
'instructions' => __('Appears within the input','acf'),
|
75 |
+
'type' => 'select',
|
76 |
+
'name' => 'mode',
|
77 |
+
'choices' => array(
|
78 |
+
'text/html' => __('Text/HTML', 'acf'),
|
79 |
+
'javascript' => __('JavaScript', 'acf'),
|
80 |
+
'css' => __('CSS', 'acf'),
|
81 |
+
'application/x-httpd-php' => __('PHP (mixed)', 'acf'),
|
82 |
+
'text/x-php' => __('PHP (plain)', 'acf'),
|
83 |
+
)
|
84 |
+
));
|
85 |
+
|
86 |
+
// Lines
|
87 |
+
acf_render_field_setting($field, array(
|
88 |
+
'label' => __('Show Lines', 'acf'),
|
89 |
+
'instructions' => 'Whether to show line numbers to the left of the editor',
|
90 |
+
'type' => 'true_false',
|
91 |
+
'name' => 'lines',
|
92 |
+
'ui' => true,
|
93 |
+
));
|
94 |
+
|
95 |
+
// Indent Unit
|
96 |
+
acf_render_field_setting($field, array(
|
97 |
+
'label' => __('Indent Unit', 'acf'),
|
98 |
+
'instructions' => 'How many spaces a block (whatever that means in the edited language) should be indented',
|
99 |
+
'type' => 'number',
|
100 |
+
'min' => 0,
|
101 |
+
'name' => 'indent_unit',
|
102 |
+
));
|
103 |
+
|
104 |
+
// maxlength
|
105 |
+
acf_render_field_setting($field, array(
|
106 |
+
'label' => __('Character Limit','acf'),
|
107 |
+
'instructions' => __('Leave blank for no limit','acf'),
|
108 |
+
'type' => 'number',
|
109 |
+
'name' => 'maxlength',
|
110 |
+
));
|
111 |
+
|
112 |
+
// rows
|
113 |
+
acf_render_field_setting($field, array(
|
114 |
+
'label' => __('Rows','acf'),
|
115 |
+
'instructions' => __('Sets the textarea height','acf'),
|
116 |
+
'type' => 'number',
|
117 |
+
'name' => 'rows',
|
118 |
+
'placeholder' => 8
|
119 |
+
));
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
function input_admin_enqueue_scripts(){
|
124 |
+
|
125 |
+
wp_enqueue_script('code-editor');
|
126 |
+
wp_enqueue_style('code-editor');
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
function validate_value($valid, $value, $field, $input){
|
131 |
+
|
132 |
+
return $this->textarea->validate_value($valid, $value, $field, $input);
|
133 |
+
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
// initialize
|
139 |
+
acf_register_field_type('acfe_field_code_editor');
|
140 |
+
|
141 |
+
endif;
|
includes/fields/field-column.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_column extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -11,10 +13,11 @@ class acfe_field_column extends acf_field{
|
|
11 |
$this->label = __('Column', 'acfe');
|
12 |
$this->category = 'layout';
|
13 |
$this->defaults = array(
|
14 |
-
'columns' => '3/6'
|
|
|
15 |
);
|
16 |
|
17 |
-
add_filter('
|
18 |
|
19 |
parent::__construct();
|
20 |
|
@@ -60,16 +63,13 @@ class acfe_field_column extends acf_field{
|
|
60 |
|
61 |
function field_wrapper_attributes($wrapper, $field){
|
62 |
|
63 |
-
if($field['
|
64 |
-
return $wrapper;
|
65 |
-
|
66 |
-
if(isset($field['endpoint']) && !empty($field['endpoint'])){
|
67 |
|
68 |
$wrapper['data-endpoint'] = $field['endpoint'];
|
69 |
|
70 |
}
|
71 |
|
72 |
-
elseif(
|
73 |
|
74 |
$wrapper['data-columns'] = $field['columns'];
|
75 |
|
@@ -96,10 +96,10 @@ class acfe_field_column extends acf_field{
|
|
96 |
function load_field($field){
|
97 |
|
98 |
$columns = '';
|
99 |
-
if(
|
100 |
$columns = ' ' . $field['columns'];
|
101 |
|
102 |
-
if(
|
103 |
$columns = ' endpoint';
|
104 |
|
105 |
$field['label'] = '(Column' . $columns .')';
|
@@ -122,4 +122,7 @@ class acfe_field_column extends acf_field{
|
|
122 |
|
123 |
}
|
124 |
|
125 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_column')):
|
7 |
+
|
8 |
class acfe_field_column extends acf_field{
|
9 |
|
10 |
function __construct(){
|
13 |
$this->label = __('Column', 'acfe');
|
14 |
$this->category = 'layout';
|
15 |
$this->defaults = array(
|
16 |
+
'columns' => '3/6',
|
17 |
+
'endpoint' => false,
|
18 |
);
|
19 |
|
20 |
+
add_filter('acfe/field_wrapper_attributes/type=acfe_column', array($this, 'field_wrapper_attributes'), 10, 2);
|
21 |
|
22 |
parent::__construct();
|
23 |
|
63 |
|
64 |
function field_wrapper_attributes($wrapper, $field){
|
65 |
|
66 |
+
if($field['endpoint']){
|
|
|
|
|
|
|
67 |
|
68 |
$wrapper['data-endpoint'] = $field['endpoint'];
|
69 |
|
70 |
}
|
71 |
|
72 |
+
elseif($field['columns']){
|
73 |
|
74 |
$wrapper['data-columns'] = $field['columns'];
|
75 |
|
96 |
function load_field($field){
|
97 |
|
98 |
$columns = '';
|
99 |
+
if($field['columns'])
|
100 |
$columns = ' ' . $field['columns'];
|
101 |
|
102 |
+
if($field['endpoint'])
|
103 |
$columns = ' endpoint';
|
104 |
|
105 |
$field['label'] = '(Column' . $columns .')';
|
122 |
|
123 |
}
|
124 |
|
125 |
+
// initialize
|
126 |
+
acf_register_field_type('acfe_field_column');
|
127 |
+
|
128 |
+
endif;
|
includes/fields/field-dynamic-message.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_dynamic_message extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -50,4 +52,7 @@ function my_acf_dynamic_message(){
|
|
50 |
|
51 |
}
|
52 |
|
53 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_dynamic_message')):
|
7 |
+
|
8 |
class acfe_field_dynamic_message extends acf_field{
|
9 |
|
10 |
function __construct(){
|
52 |
|
53 |
}
|
54 |
|
55 |
+
// initialize
|
56 |
+
acf_register_field_type('acfe_field_dynamic_message');
|
57 |
+
|
58 |
+
endif;
|
includes/fields/field-flexible-content.php
CHANGED
@@ -553,12 +553,9 @@ function acfe_flexible_layouts_settings($field){
|
|
553 |
|
554 |
}
|
555 |
|
556 |
-
add_filter('
|
557 |
function acfe_flexible_wrapper($wrapper, $field){
|
558 |
|
559 |
-
if($field['type'] !== 'flexible_content')
|
560 |
-
return $wrapper;
|
561 |
-
|
562 |
// Stylised button
|
563 |
if(acf_maybe_get($field, 'acfe_flexible_stylised_button')){
|
564 |
|
553 |
|
554 |
}
|
555 |
|
556 |
+
add_filter('acfe/field_wrapper_attributes/type=flexible_content', 'acfe_flexible_wrapper', 10, 2);
|
557 |
function acfe_flexible_wrapper($wrapper, $field){
|
558 |
|
|
|
|
|
|
|
559 |
// Stylised button
|
560 |
if(acf_maybe_get($field, 'acfe_flexible_stylised_button')){
|
561 |
|
includes/fields/field-forms.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_forms extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -373,4 +375,7 @@ class acfe_field_forms extends acf_field{
|
|
373 |
|
374 |
}
|
375 |
|
376 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_forms')):
|
7 |
+
|
8 |
class acfe_field_forms extends acf_field{
|
9 |
|
10 |
function __construct(){
|
375 |
|
376 |
}
|
377 |
|
378 |
+
// initialize
|
379 |
+
acf_register_field_type('acfe_field_forms');
|
380 |
+
|
381 |
+
endif;
|
includes/fields/field-group.php
CHANGED
@@ -6,6 +6,26 @@ if(!defined('ABSPATH'))
|
|
6 |
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' => __('Edition modal'),
|
11 |
'name' => 'acfe_group_modal',
|
@@ -51,12 +71,9 @@ function acfe_field_group_settings($field){
|
|
51 |
|
52 |
}
|
53 |
|
54 |
-
add_filter('
|
55 |
function acfe_field_group_wrapper($wrapper, $field){
|
56 |
|
57 |
-
if($field['type'] !== 'group')
|
58 |
-
return $wrapper;
|
59 |
-
|
60 |
if(isset($field['acfe_group_modal']) && !empty($field['acfe_group_modal'])){
|
61 |
|
62 |
$wrapper['data-acfe-group-modal'] = 1;
|
@@ -77,6 +94,12 @@ function acfe_field_group_wrapper($wrapper, $field){
|
|
77 |
add_filter('acf/prepare_field/type=group', 'acfe_field_group_type_class', 99);
|
78 |
function acfe_field_group_type_class($field){
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
$field['wrapper']['class'] .= ' acfe-field-group-layout-' . $field['layout'];
|
81 |
|
82 |
return $field;
|
6 |
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' => '',
|
16 |
+
'default_value' => false,
|
17 |
+
'ui' => true,
|
18 |
+
'conditional_logic' => array(
|
19 |
+
array(
|
20 |
+
array(
|
21 |
+
'field' => 'acfe_group_modal',
|
22 |
+
'operator' => '!=',
|
23 |
+
'value' => '1',
|
24 |
+
)
|
25 |
+
)
|
26 |
+
)
|
27 |
+
));
|
28 |
+
|
29 |
acf_render_field_setting($field, array(
|
30 |
'label' => __('Edition modal'),
|
31 |
'name' => 'acfe_group_modal',
|
71 |
|
72 |
}
|
73 |
|
74 |
+
add_filter('acfe/field_wrapper_attributes/type=group', 'acfe_field_group_wrapper', 10, 2);
|
75 |
function acfe_field_group_wrapper($wrapper, $field){
|
76 |
|
|
|
|
|
|
|
77 |
if(isset($field['acfe_group_modal']) && !empty($field['acfe_group_modal'])){
|
78 |
|
79 |
$wrapper['data-acfe-group-modal'] = 1;
|
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 |
+
|
103 |
$field['wrapper']['class'] .= ' acfe-field-group-layout-' . $field['layout'];
|
104 |
|
105 |
return $field;
|
includes/fields/field-hidden.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_hidden extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -47,4 +49,7 @@ class acfe_field_hidden extends acf_field{
|
|
47 |
|
48 |
}
|
49 |
|
50 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_hidden')):
|
7 |
+
|
8 |
class acfe_field_hidden extends acf_field{
|
9 |
|
10 |
function __construct(){
|
49 |
|
50 |
}
|
51 |
|
52 |
+
// initialize
|
53 |
+
acf_register_field_type('acfe_field_hidden');
|
54 |
+
|
55 |
+
endif;
|
includes/fields/field-post-statuses.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_post_statuses extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -371,4 +373,7 @@ class acfe_field_post_statuses extends acf_field{
|
|
371 |
|
372 |
}
|
373 |
|
374 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_post_statuses')):
|
7 |
+
|
8 |
class acfe_field_post_statuses extends acf_field{
|
9 |
|
10 |
function __construct(){
|
373 |
|
374 |
}
|
375 |
|
376 |
+
// initialize
|
377 |
+
acf_register_field_type('acfe_field_post_statuses');
|
378 |
+
|
379 |
+
endif;
|
includes/fields/field-post-types.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_post_types extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -371,4 +373,7 @@ class acfe_field_post_types extends acf_field{
|
|
371 |
|
372 |
}
|
373 |
|
374 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_post_types')):
|
7 |
+
|
8 |
class acfe_field_post_types extends acf_field{
|
9 |
|
10 |
function __construct(){
|
373 |
|
374 |
}
|
375 |
|
376 |
+
// initialize
|
377 |
+
acf_register_field_type('acfe_field_post_types');
|
378 |
+
|
379 |
+
endif;
|
includes/fields/field-recaptcha.php
CHANGED
@@ -5,7 +5,7 @@ if(!defined('ABSPATH'))
|
|
5 |
|
6 |
class acfe_field_recaptcha extends acf_field{
|
7 |
|
8 |
-
|
9 |
|
10 |
$this->name = 'acfe_recaptcha';
|
11 |
$this->label = __('reCAPTCHA', 'acf');
|
@@ -15,15 +15,18 @@ class acfe_field_recaptcha extends acf_field{
|
|
15 |
'disabled' => 0,
|
16 |
'readonly' => 0,
|
17 |
'version' => 'v2',
|
18 |
-
'
|
19 |
-
'
|
|
|
|
|
|
|
20 |
);
|
21 |
|
22 |
parent::__construct();
|
23 |
|
24 |
}
|
25 |
|
26 |
-
|
27 |
|
28 |
// Version
|
29 |
acf_render_field_setting($field, array(
|
@@ -31,7 +34,6 @@ class acfe_field_recaptcha extends acf_field{
|
|
31 |
'instructions' => __('Select the reCaptcha version', 'acf'),
|
32 |
'type' => 'select',
|
33 |
'name' => 'version',
|
34 |
-
'optgroup' => false,
|
35 |
'choices' => array(
|
36 |
'v2' => __('reCaptcha V2', 'acf'),
|
37 |
'v3' => __('reCaptcha V3', 'acf'),
|
@@ -44,7 +46,6 @@ class acfe_field_recaptcha extends acf_field{
|
|
44 |
'instructions' => __('Select the reCaptcha theme', 'acf'),
|
45 |
'type' => 'select',
|
46 |
'name' => 'v2_theme',
|
47 |
-
'optgroup' => false,
|
48 |
'choices' => array(
|
49 |
'light' => __('Light', 'acf'),
|
50 |
'dark' => __('Dark', 'acf'),
|
@@ -66,7 +67,6 @@ class acfe_field_recaptcha extends acf_field{
|
|
66 |
'instructions' => __('Select the reCaptcha size', 'acf'),
|
67 |
'type' => 'select',
|
68 |
'name' => 'v2_size',
|
69 |
-
'optgroup' => false,
|
70 |
'choices' => array(
|
71 |
'normal' => __('Normal', 'acf'),
|
72 |
'compact' => __('Compact', 'acf'),
|
@@ -118,16 +118,19 @@ class acfe_field_recaptcha extends acf_field{
|
|
118 |
|
119 |
}
|
120 |
|
121 |
-
|
122 |
|
123 |
-
if($field['version'] === 'v3')
|
|
|
124 |
$field['wrapper']['class'] = 'acf-hidden';
|
|
|
|
|
125 |
|
126 |
return $field;
|
127 |
|
128 |
}
|
129 |
|
130 |
-
|
131 |
|
132 |
// Site key
|
133 |
$site_key = acf_get_setting('acfe/field/recaptcha/site_key', $field['site_key']);
|
@@ -142,65 +145,30 @@ class acfe_field_recaptcha extends acf_field{
|
|
142 |
// Theme & Size
|
143 |
$field['v2_theme'] = acf_get_setting('acfe/field/recaptcha/v2/theme', $field['v2_theme']);
|
144 |
$field['v2_size'] = acf_get_setting('acfe/field/recaptcha/v2/size', $field['v2_size']);
|
145 |
-
?>
|
146 |
-
|
147 |
-
<script type="text/javascript">
|
148 |
-
acf.addAction('validation_failure', function($form){
|
149 |
-
|
150 |
-
if($form.find('.acfe-recaptcha').length)
|
151 |
-
grecaptcha.reset(acfe_recaptcha_<?php echo $field['key']; ?>);
|
152 |
-
|
153 |
-
});
|
154 |
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
};
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
jQuery('.g-recaptcha-response').change();
|
166 |
-
jQuery('input#<?php echo $field['key']; ?>').val(response).change();
|
167 |
-
jQuery('input#<?php echo $field['key']; ?>').closest('.acf-input').find('> .acf-notice.-error').hide();
|
168 |
-
|
169 |
-
};
|
170 |
-
|
171 |
-
var acfe_recaptcha_expired_<?php echo $field['key']; ?> = function(){
|
172 |
-
|
173 |
-
jQuery('input#<?php echo $field['key']; ?>').val('expired').change();
|
174 |
-
|
175 |
-
};
|
176 |
-
|
177 |
-
var acfe_recaptcha_onload_<?php echo $field['key']; ?> = function(){
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
'error-callback': 'acfe_recaptcha_error_<?php echo $field['key']; ?>',
|
182 |
-
'callback': 'acfe_recaptcha_callback_<?php echo $field['key']; ?>',
|
183 |
-
'expired-callback': 'acfe_recaptcha_expired_<?php echo $field['key']; ?>',
|
184 |
-
'theme': '<?php echo $field['v2_theme']; ?>',
|
185 |
-
'size': '<?php echo $field['v2_size']; ?>'
|
186 |
-
});
|
187 |
|
188 |
-
};
|
189 |
-
</script>
|
190 |
-
|
191 |
-
<script src="https://www.google.com/recaptcha/api.js?onload=acfe_recaptcha_onload_<?php echo $field['key']; ?>&render=explicit" async defer></script>
|
192 |
-
|
193 |
-
<div id="acfe_recaptcha_<?php echo $field['key']; ?>" class="acfe-recaptcha"></div>
|
194 |
-
|
195 |
-
<div class="acf-input-wrap">
|
196 |
-
<?php
|
197 |
-
acf_hidden_input(array(
|
198 |
-
'id' => $field['key'],
|
199 |
-
'name' => $field['name']
|
200 |
-
));
|
201 |
-
?>
|
202 |
</div>
|
203 |
|
|
|
|
|
204 |
<?php
|
205 |
return;
|
206 |
|
@@ -212,7 +180,26 @@ class acfe_field_recaptcha extends acf_field{
|
|
212 |
// Hide logo
|
213 |
$field['v3_hide_logo'] = acf_get_setting('acfe/field/recaptcha/v3/hide_logo', $field['v3_hide_logo']);
|
214 |
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
<style>
|
217 |
.grecaptcha-badge{
|
218 |
display: none;
|
@@ -221,34 +208,7 @@ class acfe_field_recaptcha extends acf_field{
|
|
221 |
</style>
|
222 |
<?php } ?>
|
223 |
|
224 |
-
<script
|
225 |
-
var acfe_recaptcha_onload_<?php echo $field['key']; ?> = function(){
|
226 |
-
|
227 |
-
grecaptcha.ready(function() {
|
228 |
-
grecaptcha.execute('<?php echo $site_key; ?>', {action: 'homepage'}).then(function(response){
|
229 |
-
|
230 |
-
jQuery('.g-recaptcha-response').change();
|
231 |
-
jQuery('input#<?php echo $field['key']; ?>').val(response).change();
|
232 |
-
jQuery('input#<?php echo $field['key']; ?>').closest('.acf-input').find('> .acf-notice.-error').hide();
|
233 |
-
|
234 |
-
});
|
235 |
-
});
|
236 |
-
|
237 |
-
};
|
238 |
-
</script>
|
239 |
-
|
240 |
-
<script src="https://www.google.com/recaptcha/api.js?render=<?php echo $site_key; ?>&onload=acfe_recaptcha_onload_<?php echo $field['key']; ?>" async defer></script>
|
241 |
-
|
242 |
-
<div id="acfe_recaptcha_<?php echo $field['key']; ?>" class="acfe-recaptcha"></div>
|
243 |
-
|
244 |
-
<div class="acf-input-wrap">
|
245 |
-
<?php
|
246 |
-
acf_hidden_input(array(
|
247 |
-
'id' => $field['key'],
|
248 |
-
'name' => $field['name']
|
249 |
-
));
|
250 |
-
?>
|
251 |
-
</div>
|
252 |
|
253 |
<?php
|
254 |
return;
|
@@ -257,17 +217,10 @@ class acfe_field_recaptcha extends acf_field{
|
|
257 |
|
258 |
}
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
// No value
|
263 |
-
if(empty($value)){
|
264 |
-
|
265 |
-
return __('This field is required.');
|
266 |
-
|
267 |
-
}
|
268 |
|
269 |
// Expired
|
270 |
-
|
271 |
|
272 |
return __('reCaptcha has expired.');
|
273 |
|
@@ -280,39 +233,59 @@ class acfe_field_recaptcha extends acf_field{
|
|
280 |
|
281 |
}
|
282 |
|
283 |
-
//
|
284 |
-
|
285 |
-
|
286 |
-
// Secret key
|
287 |
-
$secret_key = acf_get_setting('acfe/field/recaptcha/secret_key', $field['secret_key']);
|
288 |
-
|
289 |
-
// API Call
|
290 |
-
$api = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret_key}&response={$value}");
|
291 |
-
|
292 |
-
// No response
|
293 |
-
if(empty($api))
|
294 |
-
return false;
|
295 |
-
|
296 |
-
$response = json_decode($api);
|
297 |
|
298 |
-
|
|
|
299 |
|
300 |
-
$valid
|
301 |
|
302 |
}
|
303 |
|
304 |
-
|
|
|
305 |
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
}
|
309 |
|
310 |
}
|
311 |
-
|
312 |
return $valid;
|
313 |
|
314 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
}
|
317 |
|
318 |
-
|
|
5 |
|
6 |
class acfe_field_recaptcha extends acf_field{
|
7 |
|
8 |
+
function __construct(){
|
9 |
|
10 |
$this->name = 'acfe_recaptcha';
|
11 |
$this->label = __('reCAPTCHA', 'acf');
|
15 |
'disabled' => 0,
|
16 |
'readonly' => 0,
|
17 |
'version' => 'v2',
|
18 |
+
'v2_theme' => 'light',
|
19 |
+
'v2_size' => 'normal',
|
20 |
+
'v3_hide_logo' => false,
|
21 |
+
'site_key' => '',
|
22 |
+
'secret_key' => '',
|
23 |
);
|
24 |
|
25 |
parent::__construct();
|
26 |
|
27 |
}
|
28 |
|
29 |
+
function render_field_settings($field){
|
30 |
|
31 |
// Version
|
32 |
acf_render_field_setting($field, array(
|
34 |
'instructions' => __('Select the reCaptcha version', 'acf'),
|
35 |
'type' => 'select',
|
36 |
'name' => 'version',
|
|
|
37 |
'choices' => array(
|
38 |
'v2' => __('reCaptcha V2', 'acf'),
|
39 |
'v3' => __('reCaptcha V3', 'acf'),
|
46 |
'instructions' => __('Select the reCaptcha theme', 'acf'),
|
47 |
'type' => 'select',
|
48 |
'name' => 'v2_theme',
|
|
|
49 |
'choices' => array(
|
50 |
'light' => __('Light', 'acf'),
|
51 |
'dark' => __('Dark', 'acf'),
|
67 |
'instructions' => __('Select the reCaptcha size', 'acf'),
|
68 |
'type' => 'select',
|
69 |
'name' => 'v2_size',
|
|
|
70 |
'choices' => array(
|
71 |
'normal' => __('Normal', 'acf'),
|
72 |
'compact' => __('Compact', 'acf'),
|
118 |
|
119 |
}
|
120 |
|
121 |
+
function prepare_field($field){
|
122 |
|
123 |
+
if($field['version'] === 'v3'){
|
124 |
+
|
125 |
$field['wrapper']['class'] = 'acf-hidden';
|
126 |
+
|
127 |
+
}
|
128 |
|
129 |
return $field;
|
130 |
|
131 |
}
|
132 |
|
133 |
+
function render_field($field){
|
134 |
|
135 |
// Site key
|
136 |
$site_key = acf_get_setting('acfe/field/recaptcha/site_key', $field['site_key']);
|
145 |
// Theme & Size
|
146 |
$field['v2_theme'] = acf_get_setting('acfe/field/recaptcha/v2/theme', $field['v2_theme']);
|
147 |
$field['v2_size'] = acf_get_setting('acfe/field/recaptcha/v2/size', $field['v2_size']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
+
$wrapper = array(
|
150 |
+
'class' => 'acf-input-wrap acfe-field-recaptcha',
|
151 |
+
'data-site-key' => $site_key,
|
152 |
+
'data-version' => 'v2',
|
153 |
+
'data-size' => $field['v2_size'],
|
154 |
+
'data-theme' => $field['v2_theme'],
|
155 |
+
);
|
156 |
|
157 |
+
$hidden_input = array(
|
158 |
+
'id' => $field['id'],
|
159 |
+
'name' => $field['name'],
|
160 |
+
);
|
|
|
161 |
|
162 |
+
?>
|
163 |
+
<div <?php acf_esc_attr_e($wrapper); ?>>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
+
<div></div>
|
166 |
+
<?php acf_hidden_input($hidden_input); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
</div>
|
169 |
|
170 |
+
<script src="https://www.google.com/recaptcha/api.js?onload=acfe_recaptcha&render=explicit" async defer></script>
|
171 |
+
|
172 |
<?php
|
173 |
return;
|
174 |
|
180 |
// Hide logo
|
181 |
$field['v3_hide_logo'] = acf_get_setting('acfe/field/recaptcha/v3/hide_logo', $field['v3_hide_logo']);
|
182 |
|
183 |
+
$wrapper = array(
|
184 |
+
'class' => 'acf-input-wrap acfe-field-recaptcha',
|
185 |
+
'data-site-key' => $site_key,
|
186 |
+
'data-version' => 'v3',
|
187 |
+
);
|
188 |
+
|
189 |
+
$hidden_input = array(
|
190 |
+
'id' => $field['id'],
|
191 |
+
'name' => $field['name'],
|
192 |
+
);
|
193 |
+
|
194 |
+
?>
|
195 |
+
<div <?php acf_esc_attr_e($wrapper); ?>>
|
196 |
+
|
197 |
+
<div></div>
|
198 |
+
<?php acf_hidden_input($hidden_input); ?>
|
199 |
+
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<?php if($field['v3_hide_logo']){ ?>
|
203 |
<style>
|
204 |
.grecaptcha-badge{
|
205 |
display: none;
|
208 |
</style>
|
209 |
<?php } ?>
|
210 |
|
211 |
+
<script src="https://www.google.com/recaptcha/api.js?render=<?php echo $site_key; ?>&onload=acfe_recaptcha" async defer></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
<?php
|
214 |
return;
|
217 |
|
218 |
}
|
219 |
|
220 |
+
function validate_value($valid, $value, $field, $input){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
// Expired
|
223 |
+
if($value === 'expired'){
|
224 |
|
225 |
return __('reCaptcha has expired.');
|
226 |
|
233 |
|
234 |
}
|
235 |
|
236 |
+
// Only true submission
|
237 |
+
elseif(!wp_doing_ajax()){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
+
// Empty & Required
|
240 |
+
if(empty($value) && $field['required']){
|
241 |
|
242 |
+
return $valid;
|
243 |
|
244 |
}
|
245 |
|
246 |
+
// Success
|
247 |
+
else{
|
248 |
|
249 |
+
// Secret key
|
250 |
+
$secret_key = acf_get_setting('acfe/field/recaptcha/secret_key', $field['secret_key']);
|
251 |
+
|
252 |
+
// API Call
|
253 |
+
$api = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret_key}&response={$value}");
|
254 |
+
|
255 |
+
// No response
|
256 |
+
if(empty($api))
|
257 |
+
return false;
|
258 |
+
|
259 |
+
$response = json_decode($api);
|
260 |
+
|
261 |
+
if($response->success === false){
|
262 |
+
|
263 |
+
$valid = false;
|
264 |
+
|
265 |
+
}
|
266 |
+
|
267 |
+
elseif($response->success === true){
|
268 |
+
|
269 |
+
$valid = true;
|
270 |
+
|
271 |
+
}
|
272 |
|
273 |
}
|
274 |
|
275 |
}
|
276 |
+
|
277 |
return $valid;
|
278 |
|
279 |
}
|
280 |
+
|
281 |
+
function update_value($value, $post_id, $field){
|
282 |
+
|
283 |
+
// Do not save field value
|
284 |
+
return null;
|
285 |
+
|
286 |
+
}
|
287 |
|
288 |
}
|
289 |
|
290 |
+
// initialize
|
291 |
+
acf_register_field_type('acfe_field_recaptcha');
|
includes/fields/field-repeater.php
CHANGED
@@ -23,12 +23,9 @@ function acfe_repeater_settings($field){
|
|
23 |
|
24 |
}
|
25 |
|
26 |
-
add_filter('
|
27 |
function acfe_repeater_wrapper($wrapper, $field){
|
28 |
|
29 |
-
if($field['type'] !== 'repeater')
|
30 |
-
return $wrapper;
|
31 |
-
|
32 |
// Stylised button
|
33 |
if(isset($field['acfe_repeater_stylised_button']) && !empty($field['acfe_repeater_stylised_button'])){
|
34 |
|
23 |
|
24 |
}
|
25 |
|
26 |
+
add_filter('acfe/field_wrapper_attributes/type=repeater', 'acfe_repeater_wrapper', 10, 2);
|
27 |
function acfe_repeater_wrapper($wrapper, $field){
|
28 |
|
|
|
|
|
|
|
29 |
// Stylised button
|
30 |
if(isset($field['acfe_repeater_stylised_button']) && !empty($field['acfe_repeater_stylised_button'])){
|
31 |
|
includes/fields/field-slug.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_slug extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -97,4 +99,7 @@ class acfe_field_slug extends acf_field{
|
|
97 |
|
98 |
}
|
99 |
|
100 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_slug')):
|
7 |
+
|
8 |
class acfe_field_slug extends acf_field{
|
9 |
|
10 |
function __construct(){
|
99 |
|
100 |
}
|
101 |
|
102 |
+
// initialize
|
103 |
+
acf_register_field_type('acfe_field_slug');
|
104 |
+
|
105 |
+
endif;
|
includes/fields/field-taxonomies.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_taxonomies extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -371,4 +373,7 @@ class acfe_field_taxonomies extends acf_field{
|
|
371 |
|
372 |
}
|
373 |
|
374 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_taxonomies')):
|
7 |
+
|
8 |
class acfe_field_taxonomies extends acf_field{
|
9 |
|
10 |
function __construct(){
|
373 |
|
374 |
}
|
375 |
|
376 |
+
// initialize
|
377 |
+
acf_register_field_type('acfe_field_taxonomies');
|
378 |
+
|
379 |
+
endif;
|
includes/fields/field-taxonomy-terms.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_taxonomy_terms extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -12,6 +14,7 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
12 |
$this->category = 'relational';
|
13 |
$this->defaults = array(
|
14 |
'taxonomy' => array(),
|
|
|
15 |
'field_type' => 'checkbox',
|
16 |
'multiple' => 0,
|
17 |
'allow_null' => 0,
|
@@ -26,13 +29,292 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
26 |
'return_format' => 'id',
|
27 |
);
|
28 |
|
|
|
|
|
|
|
|
|
29 |
parent::__construct();
|
30 |
|
31 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
function prepare_field($field){
|
34 |
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
// Set Field Type
|
38 |
$field['type'] = $field['field_type'];
|
@@ -47,7 +329,7 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
47 |
$field['default_value'] = acf_encode_choices($field['default_value'], false);
|
48 |
|
49 |
// Allow Taxonomy
|
50 |
-
acf_render_field_setting(
|
51 |
'label' => __('Allow Taxonomy','acf'),
|
52 |
'instructions' => '',
|
53 |
'type' => 'select',
|
@@ -59,6 +341,100 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
59 |
'placeholder' => __("All taxonomies",'acf'),
|
60 |
));
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
// field_type
|
63 |
acf_render_field_setting($field, array(
|
64 |
'label' => __('Appearance','acf'),
|
@@ -73,7 +449,7 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
73 |
));
|
74 |
|
75 |
// default_value
|
76 |
-
acf_render_field_setting(
|
77 |
'label' => __('Default Value','acf'),
|
78 |
'instructions' => __('Enter each default value on a new line','acf'),
|
79 |
'name' => 'default_value',
|
@@ -95,7 +471,7 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
95 |
));
|
96 |
|
97 |
// Select: allow_null
|
98 |
-
acf_render_field_setting(
|
99 |
'label' => __('Allow Null?','acf'),
|
100 |
'instructions' => '',
|
101 |
'name' => 'allow_null',
|
@@ -335,4 +711,7 @@ class acfe_field_taxonomy_terms extends acf_field{
|
|
335 |
|
336 |
}
|
337 |
|
338 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_taxonomy_terms')):
|
7 |
+
|
8 |
class acfe_field_taxonomy_terms extends acf_field{
|
9 |
|
10 |
function __construct(){
|
14 |
$this->category = 'relational';
|
15 |
$this->defaults = array(
|
16 |
'taxonomy' => array(),
|
17 |
+
'allow_terms' => array(),
|
18 |
'field_type' => 'checkbox',
|
19 |
'multiple' => 0,
|
20 |
'allow_null' => 0,
|
29 |
'return_format' => 'id',
|
30 |
);
|
31 |
|
32 |
+
// ajax
|
33 |
+
add_action('wp_ajax_acf/fields/acfe_field_taxonomy_allow_terms/query', array($this, 'ajax_query'));
|
34 |
+
add_action('wp_ajax_nopriv_acf/fields/acfe_field_taxonomy_allow_terms/query', array($this, 'ajax_query'));
|
35 |
+
|
36 |
parent::__construct();
|
37 |
|
38 |
}
|
39 |
+
|
40 |
+
function ajax_query(){
|
41 |
+
|
42 |
+
// validate
|
43 |
+
if(!acf_verify_ajax())
|
44 |
+
die();
|
45 |
+
|
46 |
+
// get choices
|
47 |
+
$response = $this->get_ajax_query($_POST);
|
48 |
+
|
49 |
+
// return
|
50 |
+
acf_send_ajax_results($response);
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
function get_ajax_query($options = array()){
|
55 |
+
|
56 |
+
// defaults
|
57 |
+
$options = acf_parse_args($options, array(
|
58 |
+
'post_id' => 0,
|
59 |
+
's' => '',
|
60 |
+
'field_key' => '',
|
61 |
+
'paged' => 1,
|
62 |
+
'taxonomies' => array(),
|
63 |
+
'level' => false,
|
64 |
+
));
|
65 |
+
|
66 |
+
// get grouped terms
|
67 |
+
$args = array('taxonomy' => $options['taxonomies']);
|
68 |
+
|
69 |
+
$terms = acf_get_grouped_terms($args);
|
70 |
+
|
71 |
+
if($options['level'] >= 1){
|
72 |
+
|
73 |
+
// vars
|
74 |
+
$terms_final = array();
|
75 |
+
|
76 |
+
// loop over values
|
77 |
+
foreach($terms as $group => $_terms){
|
78 |
+
|
79 |
+
foreach($_terms as $term_id => $term){
|
80 |
+
|
81 |
+
if(acfe_get_term_level($term_id, $term->taxonomy) !== $options['level'])
|
82 |
+
continue;
|
83 |
+
|
84 |
+
$terms_final[$group][$term_id] = $term;
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
$terms = $terms_final;
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
$groups = acf_get_choices_from_grouped_terms($terms, 'name');
|
95 |
+
|
96 |
+
// vars
|
97 |
+
$results = array();
|
98 |
+
|
99 |
+
// loop
|
100 |
+
foreach(array_keys($groups) as $group_title){
|
101 |
+
|
102 |
+
// vars
|
103 |
+
$terms = acf_extract_var($groups, $group_title);
|
104 |
+
|
105 |
+
// data
|
106 |
+
$data = array(
|
107 |
+
'text' => $group_title,
|
108 |
+
'children' => array()
|
109 |
+
);
|
110 |
+
|
111 |
+
// append to $data
|
112 |
+
$i=0; foreach($terms as $term_id => $name){ $i++;
|
113 |
+
|
114 |
+
$term = get_term($term_id);
|
115 |
+
|
116 |
+
if($i === 1){
|
117 |
+
|
118 |
+
$id = 'all_' . $term->taxonomy;
|
119 |
+
$text = 'All ';
|
120 |
+
$taxonomy = get_taxonomy($term->taxonomy);
|
121 |
+
|
122 |
+
if($options['level'] >= 1){
|
123 |
+
|
124 |
+
$id .= '|' . $options['level'];
|
125 |
+
$text .= acfe_number_suffix($options['level']) . ' Level ';
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
$text .= $taxonomy->label;
|
130 |
+
|
131 |
+
$data['children'][] = array(
|
132 |
+
'id' => $id,
|
133 |
+
'text' => '<strong>' . $text . '</strong>'
|
134 |
+
);
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
if($term->parent !== 0){
|
139 |
+
|
140 |
+
$_term = get_term($term->parent);
|
141 |
+
|
142 |
+
$_term_choice = acf_get_choice_from_term($_term, 'name');
|
143 |
+
|
144 |
+
$data['children'][] = array(
|
145 |
+
'id' => $_term->term_id . '_childs',
|
146 |
+
'text' => '<strong>' . $_term_choice['text'] . ': Childs</strong>'
|
147 |
+
);
|
148 |
+
|
149 |
+
}
|
150 |
+
|
151 |
+
$data['children'][] = array(
|
152 |
+
'id' => $term_id,
|
153 |
+
'text' => $name
|
154 |
+
);
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
// append to $results
|
159 |
+
$results[] = $data;
|
160 |
+
|
161 |
+
}
|
162 |
+
|
163 |
+
// vars
|
164 |
+
$response = array(
|
165 |
+
'results' => $results
|
166 |
+
);
|
167 |
+
|
168 |
+
// return
|
169 |
+
return $response;
|
170 |
+
|
171 |
+
}
|
172 |
|
173 |
function prepare_field($field){
|
174 |
|
175 |
+
// Allow Terms
|
176 |
+
$choices = array();
|
177 |
+
|
178 |
+
$taxonomies = acf_get_taxonomy_labels(acf_get_array($field['taxonomy']));
|
179 |
+
|
180 |
+
$all_terms = get_terms(array(
|
181 |
+
'taxonomy' => array_keys($taxonomies),
|
182 |
+
'hide_empty' => false,
|
183 |
+
));
|
184 |
+
|
185 |
+
if(!empty($all_terms)){
|
186 |
+
|
187 |
+
foreach($all_terms as $term_id => &$term){
|
188 |
+
|
189 |
+
$level = acfe_get_term_level($term->term_id, $term->taxonomy);
|
190 |
+
$term->level = $level;
|
191 |
+
|
192 |
+
}
|
193 |
+
|
194 |
+
if(!empty($field['allow_terms'])){
|
195 |
+
|
196 |
+
$terms = array();
|
197 |
+
|
198 |
+
foreach($field['allow_terms'] as $id){
|
199 |
+
|
200 |
+
// All terms
|
201 |
+
if(acfe_starts_with($id, 'all_')){
|
202 |
+
|
203 |
+
$taxonomy = substr($id, 4);
|
204 |
+
|
205 |
+
$level = false;
|
206 |
+
|
207 |
+
if(stripos($taxonomy, '|') !== false){
|
208 |
+
|
209 |
+
$level = explode('|', $taxonomy);
|
210 |
+
$taxonomy = $level[0];
|
211 |
+
$level = $level[1];
|
212 |
+
|
213 |
+
}
|
214 |
+
|
215 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
216 |
+
continue;
|
217 |
+
|
218 |
+
$keep = array();
|
219 |
+
|
220 |
+
if($level){
|
221 |
+
|
222 |
+
foreach($all_terms as $all_term){
|
223 |
+
|
224 |
+
if((int) $all_term->level !== (int) $level || $all_term->taxonomy !== $taxonomy)
|
225 |
+
continue;
|
226 |
+
|
227 |
+
$keep[] = $all_term->term_id;
|
228 |
+
|
229 |
+
}
|
230 |
+
|
231 |
+
}else{
|
232 |
+
|
233 |
+
foreach($all_terms as $all_term){
|
234 |
+
|
235 |
+
if($all_term->taxonomy !== $taxonomy)
|
236 |
+
continue;
|
237 |
+
|
238 |
+
$keep[] = $all_term->term_id;
|
239 |
+
|
240 |
+
}
|
241 |
+
|
242 |
+
}
|
243 |
+
|
244 |
+
$terms = array_merge($terms, acf_array($keep));
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
+
// Terms childs
|
249 |
+
elseif(acfe_ends_with($id, '_childs')){
|
250 |
+
|
251 |
+
$term_id = substr($id, 0, -7);
|
252 |
+
$term = get_term($term_id);
|
253 |
+
$taxonomy = $term->taxonomy;
|
254 |
+
|
255 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
256 |
+
continue;
|
257 |
+
|
258 |
+
$keep = array();
|
259 |
+
|
260 |
+
foreach($all_terms as $all_term){
|
261 |
+
|
262 |
+
if((int) $all_term->parent !== (int) $term_id || $all_term->taxonomy !== $taxonomy)
|
263 |
+
continue;
|
264 |
+
|
265 |
+
$keep[] = $all_term->term_id;
|
266 |
+
|
267 |
+
}
|
268 |
+
|
269 |
+
$terms = array_merge($terms, acf_array($keep));
|
270 |
+
|
271 |
+
|
272 |
+
|
273 |
+
}
|
274 |
+
|
275 |
+
// Term
|
276 |
+
else{
|
277 |
+
|
278 |
+
$term = get_term($id);
|
279 |
+
$taxonomy = $term->taxonomy;
|
280 |
+
|
281 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
282 |
+
continue;
|
283 |
+
|
284 |
+
$keep = array();
|
285 |
+
$keep[] = $term->term_id;
|
286 |
+
|
287 |
+
$terms = array_merge($terms, acf_array($keep));
|
288 |
+
|
289 |
+
}
|
290 |
+
|
291 |
+
}
|
292 |
+
|
293 |
+
}
|
294 |
+
|
295 |
+
// All terms
|
296 |
+
else{
|
297 |
+
|
298 |
+
$terms = wp_list_pluck($all_terms, 'term_id');
|
299 |
+
|
300 |
+
}
|
301 |
+
|
302 |
+
$terms = array_unique($terms);
|
303 |
+
|
304 |
+
if(!empty($terms)){
|
305 |
+
|
306 |
+
$terms = acf_get_grouped_terms(array(
|
307 |
+
'include' => $terms
|
308 |
+
));
|
309 |
+
|
310 |
+
$choices = acf_get_choices_from_grouped_terms($terms, 'name');
|
311 |
+
|
312 |
+
}
|
313 |
+
|
314 |
+
}
|
315 |
+
|
316 |
+
//$field['choices'] = acfe_get_taxonomy_terms_ids($field['taxonomy']);
|
317 |
+
$field['choices'] = $choices;
|
318 |
|
319 |
// Set Field Type
|
320 |
$field['type'] = $field['field_type'];
|
329 |
$field['default_value'] = acf_encode_choices($field['default_value'], false);
|
330 |
|
331 |
// Allow Taxonomy
|
332 |
+
acf_render_field_setting($field, array(
|
333 |
'label' => __('Allow Taxonomy','acf'),
|
334 |
'instructions' => '',
|
335 |
'type' => 'select',
|
341 |
'placeholder' => __("All taxonomies",'acf'),
|
342 |
));
|
343 |
|
344 |
+
// Allow Terms
|
345 |
+
$choices = array();
|
346 |
+
|
347 |
+
if(!empty($field['allow_terms'])){
|
348 |
+
|
349 |
+
foreach($field['allow_terms'] as $id){
|
350 |
+
|
351 |
+
// All terms
|
352 |
+
if(acfe_starts_with($id, 'all_')){
|
353 |
+
|
354 |
+
$taxonomy = substr($id, 4);
|
355 |
+
|
356 |
+
$level = false;
|
357 |
+
|
358 |
+
if(stripos($taxonomy, '|') !== false){
|
359 |
+
|
360 |
+
$level = explode('|', $taxonomy);
|
361 |
+
$taxonomy = $level[0];
|
362 |
+
$level = $level[1];
|
363 |
+
|
364 |
+
$level = acfe_number_suffix($level) . ' Level ';
|
365 |
+
|
366 |
+
}
|
367 |
+
|
368 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
369 |
+
continue;
|
370 |
+
|
371 |
+
$taxonomy = get_taxonomy($taxonomy);
|
372 |
+
$value = '<strong>All ' . $level . $taxonomy->label . '</strong>';
|
373 |
+
|
374 |
+
}
|
375 |
+
|
376 |
+
// Terms childs
|
377 |
+
elseif(acfe_ends_with($id, '_childs')){
|
378 |
+
|
379 |
+
$term_id = substr($id, 0, -7);
|
380 |
+
$term = get_term($term_id);
|
381 |
+
$taxonomy = $term->taxonomy;
|
382 |
+
|
383 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
384 |
+
continue;
|
385 |
+
|
386 |
+
$value = '<strong>' . $term->name . ': childs</strong>';
|
387 |
+
|
388 |
+
}
|
389 |
+
|
390 |
+
// Term
|
391 |
+
else{
|
392 |
+
|
393 |
+
$term = get_term($id);
|
394 |
+
$taxonomy = $term->taxonomy;
|
395 |
+
|
396 |
+
if(!empty($field['taxonomy']) && !in_array($taxonomy, acf_array($field['taxonomy'])))
|
397 |
+
continue;
|
398 |
+
|
399 |
+
$term_data = acf_get_choice_from_term($term, 'name');
|
400 |
+
|
401 |
+
$value = $term_data['text'];
|
402 |
+
|
403 |
+
}
|
404 |
+
|
405 |
+
$choices[$id] = $value;
|
406 |
+
|
407 |
+
}
|
408 |
+
|
409 |
+
}
|
410 |
+
|
411 |
+
acf_render_field_setting($field, array(
|
412 |
+
'label' => __('Allow Terms','acf'),
|
413 |
+
'instructions' => '',
|
414 |
+
'type' => 'select',
|
415 |
+
'name' => 'allow_terms',
|
416 |
+
'choices' => $choices,
|
417 |
+
'multiple' => 1,
|
418 |
+
'ui' => 1,
|
419 |
+
'allow_null' => 1,
|
420 |
+
'ajax' => 1,
|
421 |
+
'placeholder' => __("All terms",'acf'),
|
422 |
+
'ajax_action' => 'acf/fields/acfe_field_taxonomy_allow_terms/query',
|
423 |
+
));
|
424 |
+
|
425 |
+
// Select: Terms level
|
426 |
+
acf_render_field_setting($field, array(
|
427 |
+
'label' => __('Terms_level','acf'),
|
428 |
+
'instructions' => '',
|
429 |
+
'name' => 'allow_level',
|
430 |
+
'type' => 'number',
|
431 |
+
'append' => 'levels',
|
432 |
+
'min' => 0,
|
433 |
+
'placeholder' => __('All','acf'),
|
434 |
+
'_append' => 'allow_terms',
|
435 |
+
'value' => false
|
436 |
+
));
|
437 |
+
|
438 |
// field_type
|
439 |
acf_render_field_setting($field, array(
|
440 |
'label' => __('Appearance','acf'),
|
449 |
));
|
450 |
|
451 |
// default_value
|
452 |
+
acf_render_field_setting($field, array(
|
453 |
'label' => __('Default Value','acf'),
|
454 |
'instructions' => __('Enter each default value on a new line','acf'),
|
455 |
'name' => 'default_value',
|
471 |
));
|
472 |
|
473 |
// Select: allow_null
|
474 |
+
acf_render_field_setting($field, array(
|
475 |
'label' => __('Allow Null?','acf'),
|
476 |
'instructions' => '',
|
477 |
'name' => 'allow_null',
|
711 |
|
712 |
}
|
713 |
|
714 |
+
// initialize
|
715 |
+
acf_register_field_type('acfe_field_taxonomy_terms');
|
716 |
+
|
717 |
+
endif;
|
includes/fields/field-textarea.php
CHANGED
@@ -11,7 +11,7 @@ function acfe_field_textarea_settings($field){
|
|
11 |
'label' => __('Code mode'),
|
12 |
'name' => 'acfe_textarea_code',
|
13 |
'key' => 'acfe_textarea_code',
|
14 |
-
'instructions' => __('Switch font family to monospace and allow tab indent'),
|
15 |
'type' => 'true_false',
|
16 |
'ui' => 1,
|
17 |
));
|
@@ -19,13 +19,10 @@ function acfe_field_textarea_settings($field){
|
|
19 |
}
|
20 |
|
21 |
// Field wrapper
|
22 |
-
add_filter('
|
23 |
function acfe_field_textarea_wrapper($wrapper, $field){
|
24 |
|
25 |
-
if($field
|
26 |
-
return $wrapper;
|
27 |
-
|
28 |
-
if(isset($field['acfe_textarea_code']) && !empty($field['acfe_textarea_code'])){
|
29 |
|
30 |
$wrapper['data-acfe-textarea-code'] = 1;
|
31 |
|
@@ -33,4 +30,21 @@ function acfe_field_textarea_wrapper($wrapper, $field){
|
|
33 |
|
34 |
return $wrapper;
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
11 |
'label' => __('Code mode'),
|
12 |
'name' => 'acfe_textarea_code',
|
13 |
'key' => 'acfe_textarea_code',
|
14 |
+
'instructions' => __('Switch font family to monospace and allow tab indent. For a more advanced code editor, please use the <code>Code Editor</code> field type'),
|
15 |
'type' => 'true_false',
|
16 |
'ui' => 1,
|
17 |
));
|
19 |
}
|
20 |
|
21 |
// Field wrapper
|
22 |
+
add_filter('acfe/field_wrapper_attributes/type=textarea', 'acfe_field_textarea_wrapper', 10, 2);
|
23 |
function acfe_field_textarea_wrapper($wrapper, $field){
|
24 |
|
25 |
+
if(acf_maybe_get($field, 'acfe_textarea_code')){
|
|
|
|
|
|
|
26 |
|
27 |
$wrapper['data-acfe-textarea-code'] = 1;
|
28 |
|
30 |
|
31 |
return $wrapper;
|
32 |
|
33 |
+
}
|
34 |
+
|
35 |
+
add_filter('acf/prepare_field/name=new_lines', 'acfe_field_textarea_new_lines');
|
36 |
+
function acfe_field_textarea_new_lines($field){
|
37 |
+
|
38 |
+
$field['conditional_logic'] = array(
|
39 |
+
array(
|
40 |
+
array(
|
41 |
+
'field' => 'acfe_textarea_code',
|
42 |
+
'operator' => '!=',
|
43 |
+
'value' => '1'
|
44 |
+
)
|
45 |
+
)
|
46 |
+
);
|
47 |
+
|
48 |
+
return $field;
|
49 |
+
|
50 |
}
|
includes/fields/field-user-roles.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
6 |
class acfe_field_user_roles extends acf_field{
|
7 |
|
8 |
function __construct(){
|
@@ -328,4 +330,7 @@ class acfe_field_user_roles extends acf_field{
|
|
328 |
|
329 |
}
|
330 |
|
331 |
-
|
|
|
|
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
if(!class_exists('acfe_field_user_roles')):
|
7 |
+
|
8 |
class acfe_field_user_roles extends acf_field{
|
9 |
|
10 |
function __construct(){
|
330 |
|
331 |
}
|
332 |
|
333 |
+
// initialize
|
334 |
+
acf_register_field_type('acfe_field_user_roles');
|
335 |
+
|
336 |
+
endif;
|
includes/modules/form/actions/email.php
CHANGED
@@ -9,13 +9,13 @@ class acfe_form_email{
|
|
9 |
|
10 |
function __construct(){
|
11 |
|
12 |
-
add_action('acfe/form/
|
13 |
|
14 |
add_filter('acf/prepare_field/name=acfe_form_email_file', array(acfe()->acfe_form, 'map_fields_deep'));
|
15 |
|
16 |
}
|
17 |
|
18 |
-
function submit($form, $post_id){
|
19 |
|
20 |
$form_name = acf_maybe_get($form, 'form_name');
|
21 |
$form_id = acf_maybe_get($form, 'form_id');
|
@@ -66,15 +66,25 @@ class acfe_form_email{
|
|
66 |
'attachments' => $attachments,
|
67 |
);
|
68 |
|
69 |
-
$args = apply_filters('acfe/form/submit/
|
70 |
-
$args = apply_filters('acfe/form/submit/
|
71 |
-
$args = apply_filters('acfe/form/submit/
|
|
|
|
|
|
|
72 |
|
73 |
if(!$args)
|
74 |
return;
|
75 |
|
76 |
wp_mail($args['to'], $args['subject'], $args['content'], $args['headers'], $args['attachments']);
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
}
|
9 |
|
10 |
function __construct(){
|
11 |
|
12 |
+
add_action('acfe/form/prepare/email', array($this, 'submit'), 1, 3);
|
13 |
|
14 |
add_filter('acf/prepare_field/name=acfe_form_email_file', array(acfe()->acfe_form, 'map_fields_deep'));
|
15 |
|
16 |
}
|
17 |
|
18 |
+
function submit($form, $post_id, $action){
|
19 |
|
20 |
$form_name = acf_maybe_get($form, 'form_name');
|
21 |
$form_id = acf_maybe_get($form, 'form_id');
|
66 |
'attachments' => $attachments,
|
67 |
);
|
68 |
|
69 |
+
$args = apply_filters('acfe/form/submit/email/args', $args, $form, $action);
|
70 |
+
$args = apply_filters('acfe/form/submit/email/args/name=' . $form_name, $args, $form, $action);
|
71 |
+
$args = apply_filters('acfe/form/submit/email/args/id=' . $form_id, $args, $form, $action);
|
72 |
+
|
73 |
+
if(!empty($action))
|
74 |
+
$args = apply_filters('acfe/form/submit/email/args/action=' . $action, $args, $form, $action);
|
75 |
|
76 |
if(!$args)
|
77 |
return;
|
78 |
|
79 |
wp_mail($args['to'], $args['subject'], $args['content'], $args['headers'], $args['attachments']);
|
80 |
|
81 |
+
do_action('acfe/form/submit/email', $args, $form, $action);
|
82 |
+
do_action('acfe/form/submit/email/name=' . $form_name, $args, $form, $action);
|
83 |
+
do_action('acfe/form/submit/email/id=' . $form_id, $args, $form, $action);
|
84 |
+
|
85 |
+
if(!empty($action))
|
86 |
+
do_action('acfe/form/submit/email/action=' . $action, $args, $form, $action);
|
87 |
+
|
88 |
}
|
89 |
|
90 |
}
|
includes/modules/form/actions/option.php
CHANGED
@@ -9,8 +9,8 @@ class acfe_form_option{
|
|
9 |
|
10 |
function __construct(){
|
11 |
|
12 |
-
add_filter('acfe/form/load/
|
13 |
-
add_action('acfe/form/submit/
|
14 |
|
15 |
}
|
16 |
|
9 |
|
10 |
function __construct(){
|
11 |
|
12 |
+
add_filter('acfe/form/load/option', array($this, 'load'), 1);
|
13 |
+
add_action('acfe/form/submit/option', array($this, 'submit'), 1, 3);
|
14 |
|
15 |
}
|
16 |
|
includes/modules/form/actions/post.php
CHANGED
@@ -12,8 +12,9 @@ class acfe_form_post{
|
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
-
add_filter('acfe/form/load/
|
16 |
-
add_action('acfe/form/
|
|
|
17 |
|
18 |
/*
|
19 |
* Admin
|
@@ -30,9 +31,13 @@ class acfe_form_post{
|
|
30 |
add_filter('acf/prepare_field/name=acfe_form_post_map_post_parent', array(acfe()->acfe_form, 'map_fields_deep'));
|
31 |
add_filter('acf/prepare_field/name=acfe_form_post_map_post_terms', array(acfe()->acfe_form, 'map_fields_deep'));
|
32 |
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
-
function load($form, $post_id){
|
36 |
|
37 |
// Form
|
38 |
$form_name = acf_maybe_get($form, 'form_name');
|
@@ -77,9 +82,11 @@ class acfe_form_post{
|
|
77 |
|
78 |
}
|
79 |
|
80 |
-
$_post_id = apply_filters('acfe/form/load/
|
81 |
-
$_post_id = apply_filters('acfe/form/load/
|
82 |
-
|
|
|
|
|
83 |
|
84 |
// Invalid Post ID
|
85 |
if(!$_post_id)
|
@@ -239,7 +246,7 @@ class acfe_form_post{
|
|
239 |
|
240 |
}
|
241 |
|
242 |
-
function
|
243 |
|
244 |
$form_name = acf_maybe_get($form, 'form_name');
|
245 |
$form_id = acf_maybe_get($form, 'form_id');
|
@@ -475,9 +482,11 @@ class acfe_form_post{
|
|
475 |
|
476 |
}
|
477 |
|
478 |
-
$args = apply_filters('acfe/form/submit/
|
479 |
-
$args = apply_filters('acfe/form/submit/
|
480 |
-
|
|
|
|
|
481 |
|
482 |
if($args === false)
|
483 |
return;
|
@@ -485,9 +494,16 @@ class acfe_form_post{
|
|
485 |
// Update Post
|
486 |
$_post_id = wp_update_post($args);
|
487 |
|
488 |
-
|
489 |
-
do_action('acfe/form/submit/
|
490 |
-
do_action('acfe/form/submit/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
|
492 |
// Meta save
|
493 |
$save_meta = get_sub_field('acfe_form_post_save_meta');
|
@@ -511,7 +527,168 @@ class acfe_form_post{
|
|
511 |
|
512 |
}
|
513 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
|
516 |
}
|
517 |
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
+
add_filter('acfe/form/load/post', array($this, 'load'), 1, 3);
|
16 |
+
add_action('acfe/form/prepare/post', array($this, 'prepare'), 1, 3);
|
17 |
+
add_action('acfe/form/submit/post', array($this, 'submit'), 10, 5);
|
18 |
|
19 |
/*
|
20 |
* Admin
|
31 |
add_filter('acf/prepare_field/name=acfe_form_post_map_post_parent', array(acfe()->acfe_form, 'map_fields_deep'));
|
32 |
add_filter('acf/prepare_field/name=acfe_form_post_map_post_terms', array(acfe()->acfe_form, 'map_fields_deep'));
|
33 |
|
34 |
+
add_filter('acf/render_field/name=acfe_form_post_advanced_load', array($this, 'advanced_load'));
|
35 |
+
add_filter('acf/render_field/name=acfe_form_post_advanced_save_args', array($this, 'advanced_save_args'));
|
36 |
+
add_filter('acf/render_field/name=acfe_form_post_advanced_save', array($this, 'advanced_save'));
|
37 |
+
|
38 |
}
|
39 |
|
40 |
+
function load($form, $post_id, $action){
|
41 |
|
42 |
// Form
|
43 |
$form_name = acf_maybe_get($form, 'form_name');
|
82 |
|
83 |
}
|
84 |
|
85 |
+
$_post_id = apply_filters('acfe/form/load/post_id', $_post_id, $form, $action);
|
86 |
+
$_post_id = apply_filters('acfe/form/load/post_id/form=' . $form_name, $_post_id, $form, $action);
|
87 |
+
|
88 |
+
if(!empty($action))
|
89 |
+
$_post_id = apply_filters('acfe/form/load/post_id/action=' . $action, $_post_id, $form, $action);
|
90 |
|
91 |
// Invalid Post ID
|
92 |
if(!$_post_id)
|
246 |
|
247 |
}
|
248 |
|
249 |
+
function prepare($form, $post_id, $action){
|
250 |
|
251 |
$form_name = acf_maybe_get($form, 'form_name');
|
252 |
$form_id = acf_maybe_get($form, 'form_id');
|
482 |
|
483 |
}
|
484 |
|
485 |
+
$args = apply_filters('acfe/form/submit/post_args', $args, $post_action, $form, $action);
|
486 |
+
$args = apply_filters('acfe/form/submit/post_args/form=' . $form_name, $args, $post_action, $form, $action);
|
487 |
+
|
488 |
+
if(!empty($action))
|
489 |
+
$args = apply_filters('acfe/form/submit/post_args/action=' . $action, $args, $post_action, $form, $action);
|
490 |
|
491 |
if($args === false)
|
492 |
return;
|
494 |
// Update Post
|
495 |
$_post_id = wp_update_post($args);
|
496 |
|
497 |
+
// Save meta
|
498 |
+
do_action('acfe/form/submit/post', $_post_id, $post_action, $args, $form, $action);
|
499 |
+
do_action('acfe/form/submit/post/form=' . $form_name, $_post_id, $post_action, $args, $form, $action);
|
500 |
+
|
501 |
+
if(!empty($action))
|
502 |
+
$args = do_action('acfe/form/submit/post/action=' . $action, $_post_id, $post_action, $args, $form, $action);
|
503 |
+
|
504 |
+
}
|
505 |
+
|
506 |
+
function submit($_post_id, $post_action, $args, $form, $action){
|
507 |
|
508 |
// Meta save
|
509 |
$save_meta = get_sub_field('acfe_form_post_save_meta');
|
527 |
|
528 |
}
|
529 |
|
530 |
+
}
|
531 |
+
|
532 |
+
function advanced_load($field){
|
533 |
+
|
534 |
+
$form_id = 100;
|
535 |
+
$form_name = 'my_form';
|
536 |
+
|
537 |
+
if(acf_maybe_get($field, 'value')){
|
538 |
+
|
539 |
+
$form_id = $field['value'];
|
540 |
+
$form_name = get_field('acfe_form_name', $form_id);
|
541 |
+
|
542 |
+
}
|
543 |
+
|
544 |
+
?>You may use the following hooks:<br /><br />
|
545 |
+
<pre>
|
546 |
+
add_filter('acfe/form/load/post_id', 'my_form_post_values_source', 10, 3);
|
547 |
+
add_filter('acfe/form/load/post_id/form=<?php echo $form_name; ?>', 'my_form_post_values_source', 10, 3);
|
548 |
+
add_filter('acfe/form/load/post_id/action=my-post-action', 'my_form_post_values_source', 10, 3);
|
549 |
+
</pre>
|
550 |
+
<br />
|
551 |
+
<pre>
|
552 |
+
add_filter('acfe/form/load/post_id/form=<?php echo $form_name; ?>', 'my_form_post_values_source', 10, 3);
|
553 |
+
function my_form_post_values_source($post_id, $form, $action){
|
554 |
+
|
555 |
+
/**
|
556 |
+
* @int $post_id Post ID used as source
|
557 |
+
* @array $form The form settings
|
558 |
+
* @string $action The action alias name
|
559 |
+
*/
|
560 |
+
|
561 |
+
|
562 |
+
/**
|
563 |
+
* Force to load values from the post ID 145
|
564 |
+
*/
|
565 |
+
$post_id = 145;
|
566 |
+
|
567 |
+
|
568 |
+
/**
|
569 |
+
* Return
|
570 |
+
*/
|
571 |
+
return $post_id;
|
572 |
+
|
573 |
+
}
|
574 |
+
</pre><?php
|
575 |
+
|
576 |
+
}
|
577 |
+
|
578 |
+
function advanced_save_args($field){
|
579 |
+
|
580 |
+
$form_id = 100;
|
581 |
+
$form_name = 'my_form';
|
582 |
+
|
583 |
+
if(acf_maybe_get($field, 'value')){
|
584 |
+
|
585 |
+
$form_id = $field['value'];
|
586 |
+
$form_name = get_field('acfe_form_name', $form_id);
|
587 |
+
|
588 |
+
}
|
589 |
+
|
590 |
+
?>You may use the following hooks:<br /><br />
|
591 |
+
<pre>
|
592 |
+
add_filter('acfe/form/submit/post_args', 'my_form_post_args', 10, 4);
|
593 |
+
add_filter('acfe/form/submit/post_args/form=<?php echo $form_name; ?>', 'my_form_post_args', 10, 4);
|
594 |
+
add_filter('acfe/form/submit/post_args/action=my-post-action', 'my_form_post_args', 10, 4);
|
595 |
+
</pre>
|
596 |
+
<br />
|
597 |
+
<pre>
|
598 |
+
add_filter('acfe/form/submit/post_args/form=<?php echo $form_name; ?>', 'my_form_post_args', 10, 4);
|
599 |
+
function my_form_post_args($args, $type, $form, $action){
|
600 |
+
|
601 |
+
/**
|
602 |
+
* @array $args The generated post arguments
|
603 |
+
* @string $type Action type: 'insert_post' or 'update_post'
|
604 |
+
* @array $form The form settings
|
605 |
+
* @string $action The action alias name
|
606 |
+
*/
|
607 |
+
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Force specific post title if the action type is 'insert_post'
|
611 |
+
*/
|
612 |
+
if($type === 'insert_post'){
|
613 |
+
|
614 |
+
$args['post_title'] = 'My title';
|
615 |
+
|
616 |
+
}
|
617 |
+
|
618 |
+
|
619 |
+
/**
|
620 |
+
* Get the form input value named 'my_field'
|
621 |
+
* This is the value entered by the user during the form submission
|
622 |
+
*/
|
623 |
+
$my_field = get_field('my_field');
|
624 |
+
|
625 |
+
|
626 |
+
/**
|
627 |
+
* Get the field value 'my_field' from the post ID 145
|
628 |
+
*/
|
629 |
+
$my_post_field = get_field('my_field', 145);
|
630 |
+
|
631 |
+
|
632 |
+
/**
|
633 |
+
* Return arguments
|
634 |
+
* Note: Return false will stop post & meta insert/update
|
635 |
+
*/
|
636 |
+
return $args;
|
637 |
+
|
638 |
+
}
|
639 |
+
</pre><?php
|
640 |
+
|
641 |
+
}
|
642 |
+
|
643 |
+
function advanced_save($field){
|
644 |
+
|
645 |
+
$form_id = 100;
|
646 |
+
$form_name = 'my_form';
|
647 |
+
|
648 |
+
if(acf_maybe_get($field, 'value')){
|
649 |
+
|
650 |
+
$form_id = $field['value'];
|
651 |
+
$form_name = get_field('acfe_form_name', $form_id);
|
652 |
+
|
653 |
+
}
|
654 |
|
655 |
+
?>You may use the following hooks:<br /><br />
|
656 |
+
<pre>
|
657 |
+
add_action('acfe/form/submit/post', 'my_form_post_save', 10, 5);
|
658 |
+
add_action('acfe/form/submit/post/form=<?php echo $form_name; ?>', 'my_form_post_save', 10, 5);
|
659 |
+
add_action('acfe/form/submit/post/action=my-post-action', 'my_form_post_save', 10, 5);
|
660 |
+
</pre>
|
661 |
+
<br />
|
662 |
+
<pre>
|
663 |
+
/**
|
664 |
+
* At this point the post & meta fields are already saved in the database
|
665 |
+
*/
|
666 |
+
add_action('acfe/form/submit/post/form=<?php echo $form_name; ?>', 'my_form_post_save', 10, 5);
|
667 |
+
function my_form_post_save($post_id, $type, $args, $form, $action){
|
668 |
+
|
669 |
+
/**
|
670 |
+
* @int $post_id The targeted post ID
|
671 |
+
* @string $type Action type: 'insert_post' or 'update_post'
|
672 |
+
* @array $args The generated post arguments
|
673 |
+
* @array $form The form settings
|
674 |
+
* @string $action The action alias name
|
675 |
+
*/
|
676 |
+
|
677 |
+
|
678 |
+
/**
|
679 |
+
* Get the value from the form input named 'my_field'
|
680 |
+
* This is the value entered by the user during the form submission
|
681 |
+
*/
|
682 |
+
$my_field = get_field('my_field');
|
683 |
+
|
684 |
+
|
685 |
+
/**
|
686 |
+
* Get the field value 'my_field' from the currently saved post
|
687 |
+
*/
|
688 |
+
$my_post_field = get_field('my_field', $post_id);
|
689 |
+
|
690 |
+
}
|
691 |
+
</pre><?php
|
692 |
|
693 |
}
|
694 |
|
includes/modules/form/actions/term.php
CHANGED
@@ -12,8 +12,9 @@ class acfe_form_term{
|
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
-
add_filter('acfe/form/load/
|
16 |
-
add_action('acfe/form/
|
|
|
17 |
|
18 |
/*
|
19 |
* Admin
|
@@ -27,9 +28,13 @@ class acfe_form_term{
|
|
27 |
add_filter('acf/prepare_field/name=acfe_form_term_map_parent', array(acfe()->acfe_form, 'map_fields_deep'));
|
28 |
add_filter('acf/prepare_field/name=acfe_form_term_map_description', array(acfe()->acfe_form, 'map_fields_deep'));
|
29 |
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
-
function load($form, $post_id){
|
33 |
|
34 |
// Form
|
35 |
$form_name = acf_maybe_get($form, 'form_name');
|
@@ -71,9 +76,11 @@ class acfe_form_term{
|
|
71 |
|
72 |
}
|
73 |
|
74 |
-
$_term_id = apply_filters('acfe/form/load/
|
75 |
-
$_term_id = apply_filters('acfe/form/load/
|
76 |
-
|
|
|
|
|
77 |
|
78 |
// Invalid Term ID
|
79 |
if(!$_term_id)
|
@@ -170,7 +177,7 @@ class acfe_form_term{
|
|
170 |
|
171 |
}
|
172 |
|
173 |
-
function
|
174 |
|
175 |
$form_name = acf_maybe_get($form, 'form_name');
|
176 |
$form_id = acf_maybe_get($form, 'form_id');
|
@@ -298,9 +305,11 @@ class acfe_form_term{
|
|
298 |
|
299 |
}
|
300 |
|
301 |
-
$args = apply_filters('acfe/form/submit/
|
302 |
-
$args = apply_filters('acfe/form/submit/
|
303 |
-
|
|
|
|
|
304 |
|
305 |
// Insert Term
|
306 |
if($term_action === 'insert_term'){
|
@@ -336,9 +345,16 @@ class acfe_form_term{
|
|
336 |
|
337 |
$_term_id = $_insert_term['term_id'];
|
338 |
|
339 |
-
|
340 |
-
do_action('acfe/form/submit/
|
341 |
-
do_action('acfe/form/submit/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
// Meta save
|
344 |
$save_meta = get_sub_field('acfe_form_term_save_meta');
|
@@ -364,6 +380,156 @@ class acfe_form_term{
|
|
364 |
|
365 |
}
|
366 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
}
|
368 |
|
369 |
new acfe_form_term();
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
+
add_filter('acfe/form/load/term', array($this, 'load'), 1, 3);
|
16 |
+
add_action('acfe/form/prepare/term', array($this, 'prepare'), 1, 3);
|
17 |
+
add_action('acfe/form/submit/term', array($this, 'submit'), 10, 5);
|
18 |
|
19 |
/*
|
20 |
* Admin
|
28 |
add_filter('acf/prepare_field/name=acfe_form_term_map_parent', array(acfe()->acfe_form, 'map_fields_deep'));
|
29 |
add_filter('acf/prepare_field/name=acfe_form_term_map_description', array(acfe()->acfe_form, 'map_fields_deep'));
|
30 |
|
31 |
+
add_filter('acf/render_field/name=acfe_form_term_advanced_load', array($this, 'advanced_load'));
|
32 |
+
add_filter('acf/render_field/name=acfe_form_term_advanced_save_args', array($this, 'advanced_save_args'));
|
33 |
+
add_filter('acf/render_field/name=acfe_form_term_advanced_save', array($this, 'advanced_save'));
|
34 |
+
|
35 |
}
|
36 |
|
37 |
+
function load($form, $post_id, $alias){
|
38 |
|
39 |
// Form
|
40 |
$form_name = acf_maybe_get($form, 'form_name');
|
76 |
|
77 |
}
|
78 |
|
79 |
+
$_term_id = apply_filters('acfe/form/load/term_id', $_term_id, $form);
|
80 |
+
$_term_id = apply_filters('acfe/form/load/term_id/form=' . $form_name, $_term_id, $form);
|
81 |
+
|
82 |
+
if(!empty($alias))
|
83 |
+
$_term_id = apply_filters('acfe/form/load/term_id/action=' . $alias, $_term_id, $form);
|
84 |
|
85 |
// Invalid Term ID
|
86 |
if(!$_term_id)
|
177 |
|
178 |
}
|
179 |
|
180 |
+
function prepare($form, $post_id, $alias){
|
181 |
|
182 |
$form_name = acf_maybe_get($form, 'form_name');
|
183 |
$form_id = acf_maybe_get($form, 'form_id');
|
305 |
|
306 |
}
|
307 |
|
308 |
+
$args = apply_filters('acfe/form/submit/term_args', $args, $term_action, $form);
|
309 |
+
$args = apply_filters('acfe/form/submit/term_args/form=' . $form_name, $args, $term_action, $form);
|
310 |
+
|
311 |
+
if(!empty($alias))
|
312 |
+
$args = apply_filters('acfe/form/submit/term_args/action=' . $alias, $args, $term_action, $form);
|
313 |
|
314 |
// Insert Term
|
315 |
if($term_action === 'insert_term'){
|
345 |
|
346 |
$_term_id = $_insert_term['term_id'];
|
347 |
|
348 |
+
// Save meta
|
349 |
+
do_action('acfe/form/submit/term', $_term_id, $term_action, $args, $form);
|
350 |
+
do_action('acfe/form/submit/term/name=' . $form_name, $_term_id, $term_action, $args, $form);
|
351 |
+
|
352 |
+
if(!empty($alias))
|
353 |
+
do_action('acfe/form/submit/term/action=' . $alias, $_term_id, $term_action, $args, $form);
|
354 |
+
|
355 |
+
}
|
356 |
+
|
357 |
+
function submit($_term_id, $term_action, $args, $form, $action){
|
358 |
|
359 |
// Meta save
|
360 |
$save_meta = get_sub_field('acfe_form_term_save_meta');
|
380 |
|
381 |
}
|
382 |
|
383 |
+
function advanced_load($field){
|
384 |
+
|
385 |
+
$form_name = 'my_form';
|
386 |
+
|
387 |
+
if(acf_maybe_get($field, 'value'))
|
388 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
389 |
+
|
390 |
+
?>You may use the following hooks:<br /><br />
|
391 |
+
<pre>
|
392 |
+
add_filter('acfe/form/load/term_id', 'my_form_term_values_source', 10, 3);
|
393 |
+
add_filter('acfe/form/load/term_id/form=<?php echo $form_name; ?>', 'my_form_term_values_source', 10, 3);
|
394 |
+
add_filter('acfe/form/load/term_id/action=my-term-action', 'my_form_term_values_source', 10, 3);
|
395 |
+
</pre>
|
396 |
+
<br />
|
397 |
+
<pre>
|
398 |
+
add_filter('acfe/form/load/term_id/form=<?php echo $form_name; ?>', 'my_form_term_values_source', 10, 3);
|
399 |
+
function my_form_term_values_source($term_id, $form, $action){
|
400 |
+
|
401 |
+
/**
|
402 |
+
* @int $term_id Term ID used as source
|
403 |
+
* @array $form The form settings
|
404 |
+
* @string $action The action alias name
|
405 |
+
*/
|
406 |
+
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Force to load values from the term ID 45
|
410 |
+
*/
|
411 |
+
$term_id = 45;
|
412 |
+
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Return
|
416 |
+
*/
|
417 |
+
return $term_id;
|
418 |
+
|
419 |
+
}
|
420 |
+
</pre><?php
|
421 |
+
|
422 |
+
}
|
423 |
+
|
424 |
+
function advanced_save_args($field){
|
425 |
+
|
426 |
+
$form_name = 'my_form';
|
427 |
+
|
428 |
+
if(acf_maybe_get($field, 'value'))
|
429 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
430 |
+
|
431 |
+
?>You may use the following hooks:<br /><br />
|
432 |
+
<pre>
|
433 |
+
add_filter('acfe/form/submit/term_args', 'my_form_term_args', 10, 4);
|
434 |
+
add_filter('acfe/form/submit/term_args/form=<?php echo $form_name; ?>', 'my_form_term_args', 10, 4);
|
435 |
+
add_filter('acfe/form/submit/term_args/action=my-term-action', 'my_form_term_args', 10, 4);
|
436 |
+
</pre>
|
437 |
+
<br />
|
438 |
+
<pre>
|
439 |
+
add_filter('acfe/form/submit/term_args/form=<?php echo $form_name; ?>', 'my_form_term_args', 10, 4);
|
440 |
+
function my_form_term_args($args, $type, $form, $action){
|
441 |
+
|
442 |
+
/**
|
443 |
+
* @array $args The generated term arguments
|
444 |
+
* @string $type Action type: 'insert_term' or 'update_term'
|
445 |
+
* @array $form The form settings
|
446 |
+
* @string $action The action alias name
|
447 |
+
*/
|
448 |
+
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Force specific description if the action type is 'insert_term'
|
452 |
+
*/
|
453 |
+
if($type === 'insert_term'){
|
454 |
+
|
455 |
+
$args['description'] = 'My term description';
|
456 |
+
|
457 |
+
}
|
458 |
+
|
459 |
+
|
460 |
+
/**
|
461 |
+
* Get the form input value named 'my_field'
|
462 |
+
* This is the value entered by the user during the form submission
|
463 |
+
*/
|
464 |
+
$my_field = get_field('my_field');
|
465 |
+
|
466 |
+
|
467 |
+
/**
|
468 |
+
* Get the field value 'my_field' from the post ID 145
|
469 |
+
*/
|
470 |
+
$my_post_field = get_field('my_field', 145);
|
471 |
+
|
472 |
+
|
473 |
+
/**
|
474 |
+
* Return arguments
|
475 |
+
* Note: Return false will stop post & meta insert/update
|
476 |
+
*/
|
477 |
+
return $args;
|
478 |
+
|
479 |
+
}
|
480 |
+
</pre><?php
|
481 |
+
|
482 |
+
}
|
483 |
+
|
484 |
+
function advanced_save($field){
|
485 |
+
|
486 |
+
$form_name = 'my_form';
|
487 |
+
|
488 |
+
if(acf_maybe_get($field, 'value'))
|
489 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
490 |
+
|
491 |
+
?>You may use the following hooks:<br /><br />
|
492 |
+
<pre>
|
493 |
+
add_action('acfe/form/submit/term', 'my_form_term_save', 10, 5);
|
494 |
+
add_action('acfe/form/submit/term/form=<?php echo $form_name; ?>', 'my_form_term_save', 10, 5);
|
495 |
+
add_action('acfe/form/submit/term/action=my-term-action', 'my_form_term_save', 10, 5);
|
496 |
+
</pre>
|
497 |
+
<br />
|
498 |
+
<pre>
|
499 |
+
/**
|
500 |
+
* At this point the term is already saved into the database
|
501 |
+
* Use a priority less than 10 to hook before ACF save meta fields
|
502 |
+
* Use a priority greater than 10 to hook after ACF save meta fields
|
503 |
+
*/
|
504 |
+
add_action('acfe/form/submit/term/form=<?php echo $form_name; ?>', 'my_form_term_save', 10, 5);
|
505 |
+
function my_form_term_save($term_id, $type, $args, $form, $action){
|
506 |
+
|
507 |
+
/**
|
508 |
+
* @int $term_id The targeted term ID
|
509 |
+
* @string $type Action type: 'insert_term' or 'update_term'
|
510 |
+
* @array $args The generated term arguments
|
511 |
+
* @array $form The form settings
|
512 |
+
* @string $action The action alias name
|
513 |
+
*/
|
514 |
+
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Get the form input value named 'my_field'
|
518 |
+
* This is the value entered by the user during the form submission
|
519 |
+
*/
|
520 |
+
$my_field = get_field('my_field');
|
521 |
+
|
522 |
+
|
523 |
+
/**
|
524 |
+
* Get the field value 'my_field' from the currently saved term
|
525 |
+
*/
|
526 |
+
$my_term_field = get_field('my_field', 'term_' . $term_id);
|
527 |
+
|
528 |
+
}
|
529 |
+
</pre><?php
|
530 |
+
|
531 |
+
}
|
532 |
+
|
533 |
}
|
534 |
|
535 |
new acfe_form_term();
|
includes/modules/form/actions/user.php
CHANGED
@@ -12,8 +12,9 @@ class acfe_form_user{
|
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
-
add_filter('acfe/form/load/
|
16 |
-
add_action('acfe/form/
|
|
|
17 |
|
18 |
/*
|
19 |
* Admin
|
@@ -32,9 +33,13 @@ class acfe_form_user{
|
|
32 |
add_filter('acf/prepare_field/name=acfe_form_user_map_description', array(acfe()->acfe_form, 'map_fields_deep'));
|
33 |
add_filter('acf/prepare_field/name=acfe_form_user_map_role', array(acfe()->acfe_form, 'map_fields_deep'));
|
34 |
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
function load($form, $post_id){
|
38 |
|
39 |
$form_name = acf_maybe_get($form, 'form_name');
|
40 |
$form_id = acf_maybe_get($form, 'form_id');
|
@@ -81,9 +86,11 @@ class acfe_form_user{
|
|
81 |
|
82 |
}
|
83 |
|
84 |
-
$_user_id = apply_filters('acfe/form/load/
|
85 |
-
$_user_id = apply_filters('acfe/form/load/
|
86 |
-
|
|
|
|
|
87 |
|
88 |
// Invalid User ID
|
89 |
if(!$_user_id)
|
@@ -253,7 +260,7 @@ class acfe_form_user{
|
|
253 |
|
254 |
}
|
255 |
|
256 |
-
function
|
257 |
|
258 |
$form_name = acf_maybe_get($form, 'form_name');
|
259 |
$form_id = acf_maybe_get($form, 'form_id');
|
@@ -467,9 +474,11 @@ class acfe_form_user{
|
|
467 |
|
468 |
}
|
469 |
|
470 |
-
$args = apply_filters('acfe/form/submit/
|
471 |
-
$args = apply_filters('acfe/form/submit/
|
472 |
-
|
|
|
|
|
473 |
|
474 |
// Insert User
|
475 |
if($user_action === 'insert_user'){
|
@@ -571,9 +580,16 @@ class acfe_form_user{
|
|
571 |
|
572 |
$_user_id = $_insert_user;
|
573 |
|
574 |
-
|
575 |
-
do_action('acfe/form/submit/
|
576 |
-
do_action('acfe/form/submit/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
|
578 |
// Meta save
|
579 |
$save_meta = get_sub_field('acfe_form_user_save_meta');
|
@@ -599,6 +615,153 @@ class acfe_form_user{
|
|
599 |
|
600 |
}
|
601 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
}
|
603 |
|
604 |
new acfe_form_user();
|
12 |
/*
|
13 |
* Form
|
14 |
*/
|
15 |
+
add_filter('acfe/form/load/user', array($this, 'load'), 1, 3);
|
16 |
+
add_action('acfe/form/prepare/user', array($this, 'prepare'), 1, 3);
|
17 |
+
add_action('acfe/form/submit/user', array($this, 'submit'), 10, 5);
|
18 |
|
19 |
/*
|
20 |
* Admin
|
33 |
add_filter('acf/prepare_field/name=acfe_form_user_map_description', array(acfe()->acfe_form, 'map_fields_deep'));
|
34 |
add_filter('acf/prepare_field/name=acfe_form_user_map_role', array(acfe()->acfe_form, 'map_fields_deep'));
|
35 |
|
36 |
+
add_filter('acf/render_field/name=acfe_form_user_advanced_load', array($this, 'advanced_load'));
|
37 |
+
add_filter('acf/render_field/name=acfe_form_user_advanced_save_args', array($this, 'advanced_save_args'));
|
38 |
+
add_filter('acf/render_field/name=acfe_form_user_advanced_save', array($this, 'advanced_save'));
|
39 |
+
|
40 |
}
|
41 |
|
42 |
+
function load($form, $post_id, $action){
|
43 |
|
44 |
$form_name = acf_maybe_get($form, 'form_name');
|
45 |
$form_id = acf_maybe_get($form, 'form_id');
|
86 |
|
87 |
}
|
88 |
|
89 |
+
$_user_id = apply_filters('acfe/form/load/user_id', $_user_id, $form, $action);
|
90 |
+
$_user_id = apply_filters('acfe/form/load/user_id/form=' . $form_name, $_user_id, $form, $action);
|
91 |
+
|
92 |
+
if(!empty($action))
|
93 |
+
$_user_id = apply_filters('acfe/form/load/user_id/action=' . $action, $_user_id, $form, $action);
|
94 |
|
95 |
// Invalid User ID
|
96 |
if(!$_user_id)
|
260 |
|
261 |
}
|
262 |
|
263 |
+
function prepare($form, $post_id, $action){
|
264 |
|
265 |
$form_name = acf_maybe_get($form, 'form_name');
|
266 |
$form_id = acf_maybe_get($form, 'form_id');
|
474 |
|
475 |
}
|
476 |
|
477 |
+
$args = apply_filters('acfe/form/submit/user_args', $args, $user_action, $form, $action);
|
478 |
+
$args = apply_filters('acfe/form/submit/user_args/form=' . $form_name, $args, $user_action, $form, $action);
|
479 |
+
|
480 |
+
if(!empty($action))
|
481 |
+
$args = apply_filters('acfe/form/submit/user_args/action=' . $action, $args, $user_action, $form, $action);
|
482 |
|
483 |
// Insert User
|
484 |
if($user_action === 'insert_user'){
|
580 |
|
581 |
$_user_id = $_insert_user;
|
582 |
|
583 |
+
// Save meta
|
584 |
+
do_action('acfe/form/submit/user', $_user_id, $user_action, $args, $form, $action);
|
585 |
+
do_action('acfe/form/submit/user/form=' . $form_name, $_user_id, $user_action, $args, $form, $action);
|
586 |
+
|
587 |
+
if(!empty($action))
|
588 |
+
do_action('acfe/form/submit/user/action=' . $action, $_user_id, $user_action, $args, $form, $action);
|
589 |
+
|
590 |
+
}
|
591 |
+
|
592 |
+
function submit($_user_id, $user_action, $args, $form, $action){
|
593 |
|
594 |
// Meta save
|
595 |
$save_meta = get_sub_field('acfe_form_user_save_meta');
|
615 |
|
616 |
}
|
617 |
|
618 |
+
function advanced_load($field){
|
619 |
+
|
620 |
+
$form_name = 'my_form';
|
621 |
+
|
622 |
+
if(acf_maybe_get($field, 'value'))
|
623 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
624 |
+
|
625 |
+
?>You may use the following hooks:<br /><br />
|
626 |
+
<pre>
|
627 |
+
add_filter('acfe/form/load/user_id', 'my_form_user_values_source', 10, 3);
|
628 |
+
add_filter('acfe/form/load/user_id/form=<?php echo $form_name; ?>', 'my_form_user_values_source', 10, 3);
|
629 |
+
add_filter('acfe/form/load/user_id/action=my-user-action', 'my_form_user_values_source', 10, 3);
|
630 |
+
</pre>
|
631 |
+
<br />
|
632 |
+
<pre>
|
633 |
+
add_filter('acfe/form/load/user_id/form=<?php echo $form_name; ?>', 'my_form_user_values_source', 10, 3);
|
634 |
+
function my_form_user_values_source($user_id, $form, $action){
|
635 |
+
|
636 |
+
/**
|
637 |
+
* @int $user_id User ID used as source
|
638 |
+
* @array $form The form settings
|
639 |
+
* @string $action The action alias name
|
640 |
+
*/
|
641 |
+
|
642 |
+
|
643 |
+
/**
|
644 |
+
* Force to load values from the user ID 12
|
645 |
+
*/
|
646 |
+
$user_id = 12;
|
647 |
+
|
648 |
+
|
649 |
+
/**
|
650 |
+
* Return
|
651 |
+
*/
|
652 |
+
return $user_id;
|
653 |
+
|
654 |
+
}
|
655 |
+
</pre><?php
|
656 |
+
|
657 |
+
}
|
658 |
+
|
659 |
+
function advanced_save_args($field){
|
660 |
+
|
661 |
+
$form_name = 'my_form';
|
662 |
+
|
663 |
+
if(acf_maybe_get($field, 'value'))
|
664 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
665 |
+
|
666 |
+
?>You may use the following hooks:<br /><br />
|
667 |
+
<pre>
|
668 |
+
add_filter('acfe/form/submit/user_args', 'my_form_user_args', 10, 4);
|
669 |
+
add_filter('acfe/form/submit/user_args/form=<?php echo $form_name; ?>', 'my_form_user_args', 10, 4);
|
670 |
+
add_filter('acfe/form/submit/user_args/action=my-user-action', 'my_form_user_args', 10, 4);
|
671 |
+
</pre>
|
672 |
+
<br />
|
673 |
+
<pre>
|
674 |
+
add_filter('acfe/form/submit/user_args/form=<?php echo $form_name; ?>', 'my_form_user_args', 10, 4);
|
675 |
+
function my_form_user_args($args, $type, $form, $action){
|
676 |
+
|
677 |
+
/**
|
678 |
+
* @array $args The generated user arguments
|
679 |
+
* @string $type Action type: 'insert_user' or 'update_user'
|
680 |
+
* @array $form The form settings
|
681 |
+
* @string $action The action alias name
|
682 |
+
*/
|
683 |
+
|
684 |
+
|
685 |
+
/**
|
686 |
+
* Force specific first name if the action type is 'insert_user'
|
687 |
+
*/
|
688 |
+
if($type === 'insert_user'){
|
689 |
+
|
690 |
+
$args['first_name'] = 'My name';
|
691 |
+
|
692 |
+
}
|
693 |
+
|
694 |
+
|
695 |
+
/**
|
696 |
+
* Get the form input value named 'my_field'
|
697 |
+
* This is the value entered by the user during the form submission
|
698 |
+
*/
|
699 |
+
$my_field = get_field('my_field');
|
700 |
+
|
701 |
+
|
702 |
+
/**
|
703 |
+
* Get the field value 'my_field' from the post ID 145
|
704 |
+
*/
|
705 |
+
$my_post_field = get_field('my_field', 145);
|
706 |
+
|
707 |
+
|
708 |
+
/**
|
709 |
+
* Return arguments
|
710 |
+
* Note: Return false will stop post & meta insert/update
|
711 |
+
*/
|
712 |
+
return $args;
|
713 |
+
|
714 |
+
}
|
715 |
+
</pre><?php
|
716 |
+
|
717 |
+
}
|
718 |
+
|
719 |
+
function advanced_save($field){
|
720 |
+
|
721 |
+
$form_name = 'my_form';
|
722 |
+
|
723 |
+
if(acf_maybe_get($field, 'value'))
|
724 |
+
$form_name = get_field('acfe_form_name', $field['value']);
|
725 |
+
|
726 |
+
?>You may use the following hooks:<br /><br />
|
727 |
+
<pre>
|
728 |
+
add_action('acfe/form/submit/user', 'my_form_user_save', 10, 5);
|
729 |
+
add_action('acfe/form/submit/user/form=<?php echo $form_name; ?>', 'my_form_user_save', 10, 5);
|
730 |
+
add_action('acfe/form/submit/user/action=my-user-action', 'my_form_user_save', 10, 5);
|
731 |
+
</pre>
|
732 |
+
<br />
|
733 |
+
<pre>
|
734 |
+
/**
|
735 |
+
* At this point the user is already saved into the database
|
736 |
+
*/
|
737 |
+
add_action('acfe/form/submit/user/name=<?php echo $form_name; ?>', 'my_form_user_save', 10, 5);
|
738 |
+
function my_form_user_save($user_id, $type, $args, $form, $action){
|
739 |
+
|
740 |
+
/**
|
741 |
+
* @int $user_id The targeted user ID
|
742 |
+
* @string $type Action type: 'insert_user' or 'update_user'
|
743 |
+
* @array $args The generated user arguments
|
744 |
+
* @array $form The form settings
|
745 |
+
* @string $action The action alias name
|
746 |
+
*/
|
747 |
+
|
748 |
+
/**
|
749 |
+
* Get the form input value named 'my_field'
|
750 |
+
* This is the value entered by the user during the form submission
|
751 |
+
*/
|
752 |
+
$my_field = get_field('my_field');
|
753 |
+
|
754 |
+
|
755 |
+
/**
|
756 |
+
* Get the field value 'my_field' from the currently saved user
|
757 |
+
*/
|
758 |
+
$my_user_field = get_field('my_field', 'user_' . $user_id);
|
759 |
+
|
760 |
+
}
|
761 |
+
</pre><?php
|
762 |
+
|
763 |
+
}
|
764 |
+
|
765 |
}
|
766 |
|
767 |
new acfe_form_user();
|
includes/modules/form/admin.php
CHANGED
@@ -1083,6 +1083,11 @@ class acfe_form{
|
|
1083 |
add_filter('acf/validate_value/name=<?php echo $field['name']; ?>', 'my_<?php echo $_field_name; ?>_validation', 10, 4);
|
1084 |
function my_<?php echo $_field_name; ?>_validation($valid, $value, $field, $input){
|
1085 |
|
|
|
|
|
|
|
|
|
|
|
1086 |
if(!$valid)
|
1087 |
return $valid;
|
1088 |
|
@@ -1110,14 +1115,19 @@ function my_<?php echo $_field_name; ?>_validation($valid, $value, $field, $inpu
|
|
1110 |
?>
|
1111 |
<pre><?php
|
1112 |
|
1113 |
-
add_action('acfe/form/validation/
|
1114 |
-
function my_<?php echo $_form_name; ?>_validation($form, $
|
1115 |
|
1116 |
/**
|
1117 |
-
* @array $form
|
1118 |
-
* @
|
1119 |
*/
|
1120 |
|
|
|
|
|
|
|
|
|
|
|
1121 |
$<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>');
|
1122 |
$<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', false, false);
|
1123 |
|
@@ -1127,6 +1137,13 @@ function my_<?php echo $_form_name; ?>_validation($form, $target_post_id){
|
|
1127 |
|
1128 |
}
|
1129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1130 |
}</pre>
|
1131 |
<?php $html = ob_get_clean();
|
1132 |
|
@@ -1146,14 +1163,19 @@ function my_<?php echo $_form_name; ?>_validation($form, $target_post_id){
|
|
1146 |
?>
|
1147 |
<pre><?php
|
1148 |
|
1149 |
-
add_action('acfe/form/submit/
|
1150 |
-
function my_<?php echo $_form_name; ?>_submit($form, $
|
1151 |
|
1152 |
/**
|
1153 |
-
* @array $form
|
1154 |
-
* @
|
1155 |
*/
|
1156 |
|
|
|
|
|
|
|
|
|
|
|
1157 |
$<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>');
|
1158 |
$<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', false, false);
|
1159 |
|
@@ -1163,6 +1185,13 @@ function my_<?php echo $_form_name; ?>_submit($form, $target_post_id){
|
|
1163 |
|
1164 |
}
|
1165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1166 |
}</pre>
|
1167 |
<?php $html = ob_get_clean();
|
1168 |
|
1083 |
add_filter('acf/validate_value/name=<?php echo $field['name']; ?>', 'my_<?php echo $_field_name; ?>_validation', 10, 4);
|
1084 |
function my_<?php echo $_field_name; ?>_validation($valid, $value, $field, $input){
|
1085 |
|
1086 |
+
/**
|
1087 |
+
* Perform custom validation on a field's value
|
1088 |
+
* Reference: <a href="https://www.advancedcustomfields.com/resources/acf-validate_value/" target="_blank">https://www.advancedcustomfields.com/resources/acf-validate_value/</a>
|
1089 |
+
*/
|
1090 |
+
|
1091 |
if(!$valid)
|
1092 |
return $valid;
|
1093 |
|
1115 |
?>
|
1116 |
<pre><?php
|
1117 |
|
1118 |
+
add_action('acfe/form/validation/form=<?php echo $form_name; ?>', 'my_<?php echo $_form_name; ?>_validation', 10, 2);
|
1119 |
+
function my_<?php echo $_form_name; ?>_validation($form, $post_id){
|
1120 |
|
1121 |
/**
|
1122 |
+
* @array $form Form arguments
|
1123 |
+
* @int/string $post_id Current post id
|
1124 |
*/
|
1125 |
|
1126 |
+
|
1127 |
+
/**
|
1128 |
+
* Get the form input value named '<?php echo $field['name']; ?>'
|
1129 |
+
* This is the value entered by the user during the form submission
|
1130 |
+
*/
|
1131 |
$<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>');
|
1132 |
$<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', false, false);
|
1133 |
|
1137 |
|
1138 |
}
|
1139 |
|
1140 |
+
|
1141 |
+
/**
|
1142 |
+
* Get the field value '<?php echo $field['name']; ?>' from the post ID 145
|
1143 |
+
*/
|
1144 |
+
$post_<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>', 145);
|
1145 |
+
$post_<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', 145, false);
|
1146 |
+
|
1147 |
}</pre>
|
1148 |
<?php $html = ob_get_clean();
|
1149 |
|
1163 |
?>
|
1164 |
<pre><?php
|
1165 |
|
1166 |
+
add_action('acfe/form/submit/form=<?php echo $form_name; ?>', 'my_<?php echo $_form_name; ?>_submit', 10, 2);
|
1167 |
+
function my_<?php echo $_form_name; ?>_submit($form, $post_id){
|
1168 |
|
1169 |
/**
|
1170 |
+
* @array $form Form arguments
|
1171 |
+
* @int/string $post_id Current post id
|
1172 |
*/
|
1173 |
|
1174 |
+
|
1175 |
+
/**
|
1176 |
+
* Get the form input value named '<?php echo $field['name']; ?>'
|
1177 |
+
* This is the value entered by the user during the form submission
|
1178 |
+
*/
|
1179 |
$<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>');
|
1180 |
$<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', false, false);
|
1181 |
|
1185 |
|
1186 |
}
|
1187 |
|
1188 |
+
|
1189 |
+
/**
|
1190 |
+
* Get the field value '<?php echo $field['name']; ?>' from the post ID 145
|
1191 |
+
*/
|
1192 |
+
$post_<?php echo $_field_name; ?> = get_field('<?php echo $field['name']; ?>', 145);
|
1193 |
+
$post_<?php echo $_field_name; ?>_unformatted = get_field('<?php echo $field['name']; ?>', 145, false);
|
1194 |
+
|
1195 |
}</pre>
|
1196 |
<?php $html = ob_get_clean();
|
1197 |
|
includes/modules/form/field-group.php
CHANGED
@@ -106,6 +106,7 @@ acf_add_local_field_group(array(
|
|
106 |
),
|
107 |
'acfe_permissions' => '',
|
108 |
'layout' => 'block',
|
|
|
109 |
'acfe_group_modal' => 0,
|
110 |
'conditional_logic' => array(
|
111 |
array(
|
@@ -218,6 +219,7 @@ acf_add_local_field_group(array(
|
|
218 |
),
|
219 |
'acfe_permissions' => '',
|
220 |
'layout' => 'block',
|
|
|
221 |
'acfe_group_modal' => 0,
|
222 |
'conditional_logic' => array(),
|
223 |
'sub_fields' => array(
|
@@ -267,7 +269,7 @@ acf_add_local_field_group(array(
|
|
267 |
'key' => 'field_acfe_form_html_before_fields',
|
268 |
'label' => 'HTML Before render',
|
269 |
'name' => 'acfe_form_html_before_fields',
|
270 |
-
'type' => '
|
271 |
'instructions' => 'Extra HTML to add before the fields',
|
272 |
'required' => 0,
|
273 |
'conditional_logic' => 0,
|
@@ -276,20 +278,17 @@ acf_add_local_field_group(array(
|
|
276 |
'class' => '',
|
277 |
'id' => '',
|
278 |
),
|
279 |
-
'hide_admin' => 0,
|
280 |
'acfe_permissions' => '',
|
281 |
'default_value' => '',
|
282 |
'placeholder' => '',
|
283 |
'maxlength' => '',
|
284 |
'rows' => 2,
|
285 |
-
'new_lines' => '',
|
286 |
-
'acfe_textarea_code' => 1,
|
287 |
),
|
288 |
array(
|
289 |
'key' => 'field_acfe_form_custom_html',
|
290 |
'label' => 'HTML Form render',
|
291 |
'name' => 'acfe_form_custom_html',
|
292 |
-
'type' => '
|
293 |
'instructions' => 'Render your own customized HTML. This will bypass the native field groups render.<br /><br />
|
294 |
Field groups may be included using <code>{field_group:group_key}</code><br/><code>{field_group:Group title}</code><br/><br/>
|
295 |
Fields may be included using <code>{field:field_key}</code><br/><code>{field:field_name}</code>',
|
@@ -306,14 +305,12 @@ acf_add_local_field_group(array(
|
|
306 |
'placeholder' => '',
|
307 |
'maxlength' => '',
|
308 |
'rows' => 12,
|
309 |
-
'new_lines' => '',
|
310 |
-
'acfe_textarea_code' => 1,
|
311 |
),
|
312 |
array(
|
313 |
'key' => 'field_acfe_form_html_after_fields',
|
314 |
'label' => 'HTML After render',
|
315 |
'name' => 'acfe_form_html_after_fields',
|
316 |
-
'type' => '
|
317 |
'instructions' => 'Extra HTML to add after the fields',
|
318 |
'required' => 0,
|
319 |
'conditional_logic' => 0,
|
@@ -322,14 +319,11 @@ acf_add_local_field_group(array(
|
|
322 |
'class' => '',
|
323 |
'id' => '',
|
324 |
),
|
325 |
-
'hide_admin' => 0,
|
326 |
'acfe_permissions' => '',
|
327 |
'default_value' => '',
|
328 |
'placeholder' => '',
|
329 |
'maxlength' => '',
|
330 |
'rows' => 2,
|
331 |
-
'new_lines' => '',
|
332 |
-
'acfe_textarea_code' => 1,
|
333 |
),
|
334 |
array(
|
335 |
'key' => 'field_acfe_form_form_submit',
|
@@ -385,7 +379,7 @@ acf_add_local_field_group(array(
|
|
385 |
'key' => 'field_acfe_form_html_submit_button',
|
386 |
'label' => 'Submit button',
|
387 |
'name' => 'acfe_form_html_submit_button',
|
388 |
-
'type' => '
|
389 |
'instructions' => 'HTML used to render the submit button.',
|
390 |
'required' => 0,
|
391 |
'conditional_logic' => array(
|
@@ -402,20 +396,17 @@ acf_add_local_field_group(array(
|
|
402 |
'class' => '',
|
403 |
'id' => '',
|
404 |
),
|
405 |
-
'hide_admin' => 0,
|
406 |
'acfe_permissions' => '',
|
407 |
'default_value' => '<input type="submit" class="acf-button button button-primary button-large" value="%s" />',
|
408 |
'placeholder' => '',
|
409 |
'maxlength' => '',
|
410 |
'rows' => 2,
|
411 |
-
'new_lines' => '',
|
412 |
-
'acfe_textarea_code' => 1,
|
413 |
),
|
414 |
array(
|
415 |
'key' => 'field_acfe_form_html_submit_spinner',
|
416 |
'label' => 'Submit spinner',
|
417 |
'name' => 'acfe_form_html_submit_spinner',
|
418 |
-
'type' => '
|
419 |
'instructions' => 'HTML used to render the submit button loading spinner.',
|
420 |
'required' => 0,
|
421 |
'conditional_logic' => array(
|
@@ -432,14 +423,11 @@ acf_add_local_field_group(array(
|
|
432 |
'class' => '',
|
433 |
'id' => '',
|
434 |
),
|
435 |
-
'hide_admin' => 0,
|
436 |
'acfe_permissions' => '',
|
437 |
'default_value' => '<span class="acf-spinner"></span>',
|
438 |
'placeholder' => '',
|
439 |
'maxlength' => '',
|
440 |
'rows' => 2,
|
441 |
-
'new_lines' => '',
|
442 |
-
'acfe_textarea_code' => 1,
|
443 |
),
|
444 |
array(
|
445 |
'key' => 'field_acfe_form_tab_submission',
|
@@ -587,7 +575,7 @@ acf_add_local_field_group(array(
|
|
587 |
'key' => 'field_acfe_form_html_updated_message',
|
588 |
'label' => 'Success wrapper HTML',
|
589 |
'name' => 'acfe_form_html_updated_message',
|
590 |
-
'type' => '
|
591 |
'instructions' => 'HTML used to render the updated message.<br /><br />
|
592 |
If used, you have to include the following code <code>%s</code> to print the actual \'Success message\' above.',
|
593 |
'required' => 0,
|
@@ -597,14 +585,11 @@ acf_add_local_field_group(array(
|
|
597 |
'class' => '',
|
598 |
'id' => '',
|
599 |
),
|
600 |
-
'hide_admin' => 0,
|
601 |
'acfe_permissions' => '',
|
602 |
'default_value' => '<div id="message" class="updated">%s</div>',
|
603 |
'placeholder' => '',
|
604 |
'maxlength' => '',
|
605 |
'rows' => 2,
|
606 |
-
'new_lines' => '',
|
607 |
-
'acfe_textarea_code' => 1,
|
608 |
),
|
609 |
array(
|
610 |
'key' => 'field_acfe_form_updated_hide_form',
|
@@ -711,8 +696,8 @@ acf_add_local_field_group(array(
|
|
711 |
'key' => 'field_acfe_form_custom_action',
|
712 |
'label' => 'Action name',
|
713 |
'name' => 'acfe_form_custom_action',
|
714 |
-
'type' => '
|
715 |
-
'instructions' => '
|
716 |
'required' => 1,
|
717 |
'conditional_logic' => 0,
|
718 |
'wrapper' => array(
|
@@ -722,7 +707,7 @@ acf_add_local_field_group(array(
|
|
722 |
),
|
723 |
'acfe_permissions' => '',
|
724 |
'default_value' => '',
|
725 |
-
'placeholder' => '',
|
726 |
'prepend' => '',
|
727 |
'append' => '',
|
728 |
'maxlength' => '',
|
@@ -760,6 +745,27 @@ acf_add_local_field_group(array(
|
|
760 |
'new_lines' => '',
|
761 |
'esc_html' => 0,
|
762 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
763 |
array(
|
764 |
'key' => 'field_acfe_form_email_from',
|
765 |
'label' => 'From',
|
@@ -1080,6 +1086,27 @@ acf_add_local_field_group(array(
|
|
1080 |
'return_format' => 'value',
|
1081 |
'save_other_choice' => 0,
|
1082 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1083 |
array(
|
1084 |
'key' => 'field_acfe_form_post_save_target',
|
1085 |
'label' => 'Target',
|
@@ -1252,6 +1279,7 @@ acf_add_local_field_group(array(
|
|
1252 |
),
|
1253 |
'acfe_permissions' => '',
|
1254 |
'layout' => 'block',
|
|
|
1255 |
'acfe_group_modal' => 0,
|
1256 |
'sub_fields' => array(
|
1257 |
array(
|
@@ -1355,6 +1383,7 @@ acf_add_local_field_group(array(
|
|
1355 |
),
|
1356 |
'acfe_permissions' => '',
|
1357 |
'layout' => 'block',
|
|
|
1358 |
'acfe_group_modal' => 0,
|
1359 |
'sub_fields' => array(
|
1360 |
array(
|
@@ -1458,6 +1487,7 @@ acf_add_local_field_group(array(
|
|
1458 |
),
|
1459 |
'acfe_permissions' => '',
|
1460 |
'layout' => 'block',
|
|
|
1461 |
'acfe_group_modal' => 0,
|
1462 |
'sub_fields' => array(
|
1463 |
array(
|
@@ -2048,6 +2078,71 @@ acf_add_local_field_group(array(
|
|
2048 |
'placeholder' => 'Default',
|
2049 |
'ajax' => 0,
|
2050 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2051 |
),
|
2052 |
'min' => '',
|
2053 |
'max' => '',
|
@@ -2104,6 +2199,27 @@ acf_add_local_field_group(array(
|
|
2104 |
'return_format' => 'value',
|
2105 |
'save_other_choice' => 0,
|
2106 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2107 |
array(
|
2108 |
'key' => 'field_acfe_form_term_save_target',
|
2109 |
'label' => 'Target',
|
@@ -2160,6 +2276,7 @@ acf_add_local_field_group(array(
|
|
2160 |
),
|
2161 |
'acfe_permissions' => '',
|
2162 |
'layout' => 'block',
|
|
|
2163 |
'acfe_group_modal' => 0,
|
2164 |
'sub_fields' => array(
|
2165 |
array(
|
@@ -2262,6 +2379,7 @@ acf_add_local_field_group(array(
|
|
2262 |
),
|
2263 |
'acfe_permissions' => '',
|
2264 |
'layout' => 'block',
|
|
|
2265 |
'acfe_group_modal' => 0,
|
2266 |
'sub_fields' => array(
|
2267 |
array(
|
@@ -2476,6 +2594,7 @@ acf_add_local_field_group(array(
|
|
2476 |
),
|
2477 |
'acfe_permissions' => '',
|
2478 |
'layout' => 'block',
|
|
|
2479 |
'acfe_group_modal' => 0,
|
2480 |
'sub_fields' => array(
|
2481 |
array(
|
@@ -2825,6 +2944,71 @@ acf_add_local_field_group(array(
|
|
2825 |
'placeholder' => 'Default',
|
2826 |
'ajax' => 0,
|
2827 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2828 |
),
|
2829 |
'min' => '',
|
2830 |
'max' => '',
|
@@ -2881,6 +3065,27 @@ acf_add_local_field_group(array(
|
|
2881 |
'return_format' => 'value',
|
2882 |
'save_other_choice' => 0,
|
2883 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2884 |
array(
|
2885 |
'key' => 'field_acfe_form_user_save_target',
|
2886 |
'label' => 'Target',
|
@@ -2937,6 +3142,7 @@ acf_add_local_field_group(array(
|
|
2937 |
),
|
2938 |
'acfe_permissions' => '',
|
2939 |
'layout' => 'block',
|
|
|
2940 |
'acfe_group_modal' => 0,
|
2941 |
'sub_fields' => array(
|
2942 |
array(
|
@@ -3039,6 +3245,7 @@ acf_add_local_field_group(array(
|
|
3039 |
),
|
3040 |
'acfe_permissions' => '',
|
3041 |
'layout' => 'block',
|
|
|
3042 |
'acfe_group_modal' => 0,
|
3043 |
'sub_fields' => array(
|
3044 |
array(
|
@@ -3141,6 +3348,7 @@ acf_add_local_field_group(array(
|
|
3141 |
),
|
3142 |
'acfe_permissions' => '',
|
3143 |
'layout' => 'block',
|
|
|
3144 |
'acfe_group_modal' => 0,
|
3145 |
'sub_fields' => array(
|
3146 |
array(
|
@@ -3244,6 +3452,7 @@ acf_add_local_field_group(array(
|
|
3244 |
),
|
3245 |
'acfe_permissions' => '',
|
3246 |
'layout' => 'block',
|
|
|
3247 |
'acfe_group_modal' => 0,
|
3248 |
'sub_fields' => array(
|
3249 |
array(
|
@@ -3346,6 +3555,7 @@ acf_add_local_field_group(array(
|
|
3346 |
),
|
3347 |
'acfe_permissions' => '',
|
3348 |
'layout' => 'block',
|
|
|
3349 |
'acfe_group_modal' => 0,
|
3350 |
'sub_fields' => array(
|
3351 |
array(
|
@@ -3448,6 +3658,7 @@ acf_add_local_field_group(array(
|
|
3448 |
),
|
3449 |
'acfe_permissions' => '',
|
3450 |
'layout' => 'block',
|
|
|
3451 |
'acfe_group_modal' => 0,
|
3452 |
'sub_fields' => array(
|
3453 |
array(
|
@@ -3550,6 +3761,7 @@ acf_add_local_field_group(array(
|
|
3550 |
),
|
3551 |
'acfe_permissions' => '',
|
3552 |
'layout' => 'block',
|
|
|
3553 |
'acfe_group_modal' => 0,
|
3554 |
'sub_fields' => array(
|
3555 |
array(
|
@@ -3652,6 +3864,7 @@ acf_add_local_field_group(array(
|
|
3652 |
),
|
3653 |
'acfe_permissions' => '',
|
3654 |
'layout' => 'block',
|
|
|
3655 |
'acfe_group_modal' => 0,
|
3656 |
'sub_fields' => array(
|
3657 |
array(
|
@@ -3754,6 +3967,7 @@ acf_add_local_field_group(array(
|
|
3754 |
),
|
3755 |
'acfe_permissions' => '',
|
3756 |
'layout' => 'block',
|
|
|
3757 |
'acfe_group_modal' => 0,
|
3758 |
'sub_fields' => array(
|
3759 |
array(
|
@@ -4285,6 +4499,71 @@ acf_add_local_field_group(array(
|
|
4285 |
'placeholder' => 'Default',
|
4286 |
'ajax' => 0,
|
4287 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4288 |
),
|
4289 |
'min' => '',
|
4290 |
'max' => '',
|
106 |
),
|
107 |
'acfe_permissions' => '',
|
108 |
'layout' => 'block',
|
109 |
+
'acfe_seemless_style' => true,
|
110 |
'acfe_group_modal' => 0,
|
111 |
'conditional_logic' => array(
|
112 |
array(
|
219 |
),
|
220 |
'acfe_permissions' => '',
|
221 |
'layout' => 'block',
|
222 |
+
'acfe_seemless_style' => true,
|
223 |
'acfe_group_modal' => 0,
|
224 |
'conditional_logic' => array(),
|
225 |
'sub_fields' => array(
|
269 |
'key' => 'field_acfe_form_html_before_fields',
|
270 |
'label' => 'HTML Before render',
|
271 |
'name' => 'acfe_form_html_before_fields',
|
272 |
+
'type' => 'acfe_code_editor',
|
273 |
'instructions' => 'Extra HTML to add before the fields',
|
274 |
'required' => 0,
|
275 |
'conditional_logic' => 0,
|
278 |
'class' => '',
|
279 |
'id' => '',
|
280 |
),
|
|
|
281 |
'acfe_permissions' => '',
|
282 |
'default_value' => '',
|
283 |
'placeholder' => '',
|
284 |
'maxlength' => '',
|
285 |
'rows' => 2,
|
|
|
|
|
286 |
),
|
287 |
array(
|
288 |
'key' => 'field_acfe_form_custom_html',
|
289 |
'label' => 'HTML Form render',
|
290 |
'name' => 'acfe_form_custom_html',
|
291 |
+
'type' => 'acfe_code_editor',
|
292 |
'instructions' => 'Render your own customized HTML. This will bypass the native field groups render.<br /><br />
|
293 |
Field groups may be included using <code>{field_group:group_key}</code><br/><code>{field_group:Group title}</code><br/><br/>
|
294 |
Fields may be included using <code>{field:field_key}</code><br/><code>{field:field_name}</code>',
|
305 |
'placeholder' => '',
|
306 |
'maxlength' => '',
|
307 |
'rows' => 12,
|
|
|
|
|
308 |
),
|
309 |
array(
|
310 |
'key' => 'field_acfe_form_html_after_fields',
|
311 |
'label' => 'HTML After render',
|
312 |
'name' => 'acfe_form_html_after_fields',
|
313 |
+
'type' => 'acfe_code_editor',
|
314 |
'instructions' => 'Extra HTML to add after the fields',
|
315 |
'required' => 0,
|
316 |
'conditional_logic' => 0,
|
319 |
'class' => '',
|
320 |
'id' => '',
|
321 |
),
|
|
|
322 |
'acfe_permissions' => '',
|
323 |
'default_value' => '',
|
324 |
'placeholder' => '',
|
325 |
'maxlength' => '',
|
326 |
'rows' => 2,
|
|
|
|
|
327 |
),
|
328 |
array(
|
329 |
'key' => 'field_acfe_form_form_submit',
|
379 |
'key' => 'field_acfe_form_html_submit_button',
|
380 |
'label' => 'Submit button',
|
381 |
'name' => 'acfe_form_html_submit_button',
|
382 |
+
'type' => 'acfe_code_editor',
|
383 |
'instructions' => 'HTML used to render the submit button.',
|
384 |
'required' => 0,
|
385 |
'conditional_logic' => array(
|
396 |
'class' => '',
|
397 |
'id' => '',
|
398 |
),
|
|
|
399 |
'acfe_permissions' => '',
|
400 |
'default_value' => '<input type="submit" class="acf-button button button-primary button-large" value="%s" />',
|
401 |
'placeholder' => '',
|
402 |
'maxlength' => '',
|
403 |
'rows' => 2,
|
|
|
|
|
404 |
),
|
405 |
array(
|
406 |
'key' => 'field_acfe_form_html_submit_spinner',
|
407 |
'label' => 'Submit spinner',
|
408 |
'name' => 'acfe_form_html_submit_spinner',
|
409 |
+
'type' => 'acfe_code_editor',
|
410 |
'instructions' => 'HTML used to render the submit button loading spinner.',
|
411 |
'required' => 0,
|
412 |
'conditional_logic' => array(
|
423 |
'class' => '',
|
424 |
'id' => '',
|
425 |
),
|
|
|
426 |
'acfe_permissions' => '',
|
427 |
'default_value' => '<span class="acf-spinner"></span>',
|
428 |
'placeholder' => '',
|
429 |
'maxlength' => '',
|
430 |
'rows' => 2,
|
|
|
|
|
431 |
),
|
432 |
array(
|
433 |
'key' => 'field_acfe_form_tab_submission',
|
575 |
'key' => 'field_acfe_form_html_updated_message',
|
576 |
'label' => 'Success wrapper HTML',
|
577 |
'name' => 'acfe_form_html_updated_message',
|
578 |
+
'type' => 'acfe_code_editor',
|
579 |
'instructions' => 'HTML used to render the updated message.<br /><br />
|
580 |
If used, you have to include the following code <code>%s</code> to print the actual \'Success message\' above.',
|
581 |
'required' => 0,
|
585 |
'class' => '',
|
586 |
'id' => '',
|
587 |
),
|
|
|
588 |
'acfe_permissions' => '',
|
589 |
'default_value' => '<div id="message" class="updated">%s</div>',
|
590 |
'placeholder' => '',
|
591 |
'maxlength' => '',
|
592 |
'rows' => 2,
|
|
|
|
|
593 |
),
|
594 |
array(
|
595 |
'key' => 'field_acfe_form_updated_hide_form',
|
696 |
'key' => 'field_acfe_form_custom_action',
|
697 |
'label' => 'Action name',
|
698 |
'name' => 'acfe_form_custom_action',
|
699 |
+
'type' => 'acfe_slug',
|
700 |
+
'instructions' => 'Use the following hook:<br /><code>action(\'acfe/form/submit/my-custom-action\', $form, $current_post_id)</code>',
|
701 |
'required' => 1,
|
702 |
'conditional_logic' => 0,
|
703 |
'wrapper' => array(
|
707 |
),
|
708 |
'acfe_permissions' => '',
|
709 |
'default_value' => '',
|
710 |
+
'placeholder' => 'my-custom-action',
|
711 |
'prepend' => '',
|
712 |
'append' => '',
|
713 |
'maxlength' => '',
|
745 |
'new_lines' => '',
|
746 |
'esc_html' => 0,
|
747 |
),
|
748 |
+
array(
|
749 |
+
'key' => 'field_acfe_form_email_custom_alias',
|
750 |
+
'label' => 'Action alias',
|
751 |
+
'name' => 'acfe_form_custom_alias',
|
752 |
+
'type' => 'acfe_slug',
|
753 |
+
'instructions' => '',
|
754 |
+
'required' => 0,
|
755 |
+
'conditional_logic' => 0,
|
756 |
+
'wrapper' => array(
|
757 |
+
'width' => '',
|
758 |
+
'class' => '',
|
759 |
+
'id' => '',
|
760 |
+
),
|
761 |
+
'hide_admin' => 0,
|
762 |
+
'acfe_permissions' => '',
|
763 |
+
'default_value' => '',
|
764 |
+
'placeholder' => 'my-email-action',
|
765 |
+
'prepend' => '',
|
766 |
+
'append' => '',
|
767 |
+
'maxlength' => '',
|
768 |
+
),
|
769 |
array(
|
770 |
'key' => 'field_acfe_form_email_from',
|
771 |
'label' => 'From',
|
1086 |
'return_format' => 'value',
|
1087 |
'save_other_choice' => 0,
|
1088 |
),
|
1089 |
+
array(
|
1090 |
+
'key' => 'field_acfe_form_post_custom_alias',
|
1091 |
+
'label' => 'Action alias',
|
1092 |
+
'name' => 'acfe_form_custom_alias',
|
1093 |
+
'type' => 'acfe_slug',
|
1094 |
+
'instructions' => '',
|
1095 |
+
'required' => 0,
|
1096 |
+
'conditional_logic' => 0,
|
1097 |
+
'wrapper' => array(
|
1098 |
+
'width' => '',
|
1099 |
+
'class' => '',
|
1100 |
+
'id' => '',
|
1101 |
+
),
|
1102 |
+
'hide_admin' => 0,
|
1103 |
+
'acfe_permissions' => '',
|
1104 |
+
'default_value' => '',
|
1105 |
+
'placeholder' => 'my-post-action',
|
1106 |
+
'prepend' => '',
|
1107 |
+
'append' => '',
|
1108 |
+
'maxlength' => '',
|
1109 |
+
),
|
1110 |
array(
|
1111 |
'key' => 'field_acfe_form_post_save_target',
|
1112 |
'label' => 'Target',
|
1279 |
),
|
1280 |
'acfe_permissions' => '',
|
1281 |
'layout' => 'block',
|
1282 |
+
'acfe_seemless_style' => true,
|
1283 |
'acfe_group_modal' => 0,
|
1284 |
'sub_fields' => array(
|
1285 |
array(
|
1383 |
),
|
1384 |
'acfe_permissions' => '',
|
1385 |
'layout' => 'block',
|
1386 |
+
'acfe_seemless_style' => true,
|
1387 |
'acfe_group_modal' => 0,
|
1388 |
'sub_fields' => array(
|
1389 |
array(
|
1487 |
),
|
1488 |
'acfe_permissions' => '',
|
1489 |
'layout' => 'block',
|
1490 |
+
'acfe_seemless_style' => true,
|
1491 |
'acfe_group_modal' => 0,
|
1492 |
'sub_fields' => array(
|
1493 |
array(
|
2078 |
'placeholder' => 'Default',
|
2079 |
'ajax' => 0,
|
2080 |
),
|
2081 |
+
array(
|
2082 |
+
'key' => 'field_acfe_form_post_tab_advanced',
|
2083 |
+
'label' => 'Advanced',
|
2084 |
+
'name' => '',
|
2085 |
+
'type' => 'tab',
|
2086 |
+
'instructions' => '',
|
2087 |
+
'required' => 0,
|
2088 |
+
'conditional_logic' => 0,
|
2089 |
+
'wrapper' => array(
|
2090 |
+
'width' => '',
|
2091 |
+
'class' => '',
|
2092 |
+
'id' => '',
|
2093 |
+
),
|
2094 |
+
'acfe_permissions' => '',
|
2095 |
+
'placement' => 'top',
|
2096 |
+
'endpoint' => 0,
|
2097 |
+
),
|
2098 |
+
array(
|
2099 |
+
'key' => 'field_acfe_form_post_advanced_load',
|
2100 |
+
'label' => 'Change values source',
|
2101 |
+
'name' => 'acfe_form_post_advanced_load',
|
2102 |
+
'type' => 'acfe_dynamic_message',
|
2103 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
2104 |
+
'instructions' => 'Dynamically alter the post ID where meta values are loaded from',
|
2105 |
+
'required' => 0,
|
2106 |
+
'conditional_logic' => 0,
|
2107 |
+
'wrapper' => array(
|
2108 |
+
'width' => '',
|
2109 |
+
'class' => '',
|
2110 |
+
'id' => '',
|
2111 |
+
),
|
2112 |
+
'acfe_permissions' => '',
|
2113 |
+
),
|
2114 |
+
array(
|
2115 |
+
'key' => 'field_acfe_form_post_advanced_save_args',
|
2116 |
+
'label' => 'Change post arguments',
|
2117 |
+
'name' => 'acfe_form_post_advanced_save_args',
|
2118 |
+
'type' => 'acfe_dynamic_message',
|
2119 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
2120 |
+
'instructions' => 'Dynamically alter the post arguments before database insert/update',
|
2121 |
+
'required' => 0,
|
2122 |
+
'conditional_logic' => 0,
|
2123 |
+
'wrapper' => array(
|
2124 |
+
'width' => '',
|
2125 |
+
'class' => '',
|
2126 |
+
'id' => '',
|
2127 |
+
),
|
2128 |
+
'acfe_permissions' => '',
|
2129 |
+
),
|
2130 |
+
array(
|
2131 |
+
'key' => 'field_acfe_form_post_advanced_save',
|
2132 |
+
'label' => 'Add custom action on post save',
|
2133 |
+
'name' => 'acfe_form_post_advanced_save',
|
2134 |
+
'type' => 'acfe_dynamic_message',
|
2135 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
2136 |
+
'instructions' => 'This action allows you to hook in before or after the meta data have been saved',
|
2137 |
+
'required' => 0,
|
2138 |
+
'conditional_logic' => 0,
|
2139 |
+
'wrapper' => array(
|
2140 |
+
'width' => '',
|
2141 |
+
'class' => '',
|
2142 |
+
'id' => '',
|
2143 |
+
),
|
2144 |
+
'acfe_permissions' => '',
|
2145 |
+
),
|
2146 |
),
|
2147 |
'min' => '',
|
2148 |
'max' => '',
|
2199 |
'return_format' => 'value',
|
2200 |
'save_other_choice' => 0,
|
2201 |
),
|
2202 |
+
array(
|
2203 |
+
'key' => 'field_acfe_form_term_custom_alias',
|
2204 |
+
'label' => 'Action alias',
|
2205 |
+
'name' => 'acfe_form_custom_alias',
|
2206 |
+
'type' => 'acfe_slug',
|
2207 |
+
'instructions' => '',
|
2208 |
+
'required' => 0,
|
2209 |
+
'conditional_logic' => 0,
|
2210 |
+
'wrapper' => array(
|
2211 |
+
'width' => '',
|
2212 |
+
'class' => '',
|
2213 |
+
'id' => '',
|
2214 |
+
),
|
2215 |
+
'hide_admin' => 0,
|
2216 |
+
'acfe_permissions' => '',
|
2217 |
+
'default_value' => '',
|
2218 |
+
'placeholder' => 'my-term-action',
|
2219 |
+
'prepend' => '',
|
2220 |
+
'append' => '',
|
2221 |
+
'maxlength' => '',
|
2222 |
+
),
|
2223 |
array(
|
2224 |
'key' => 'field_acfe_form_term_save_target',
|
2225 |
'label' => 'Target',
|
2276 |
),
|
2277 |
'acfe_permissions' => '',
|
2278 |
'layout' => 'block',
|
2279 |
+
'acfe_seemless_style' => true,
|
2280 |
'acfe_group_modal' => 0,
|
2281 |
'sub_fields' => array(
|
2282 |
array(
|
2379 |
),
|
2380 |
'acfe_permissions' => '',
|
2381 |
'layout' => 'block',
|
2382 |
+
'acfe_seemless_style' => true,
|
2383 |
'acfe_group_modal' => 0,
|
2384 |
'sub_fields' => array(
|
2385 |
array(
|
2594 |
),
|
2595 |
'acfe_permissions' => '',
|
2596 |
'layout' => 'block',
|
2597 |
+
'acfe_seemless_style' => true,
|
2598 |
'acfe_group_modal' => 0,
|
2599 |
'sub_fields' => array(
|
2600 |
array(
|
2944 |
'placeholder' => 'Default',
|
2945 |
'ajax' => 0,
|
2946 |
),
|
2947 |
+
array(
|
2948 |
+
'key' => 'field_acfe_form_term_tab_advanced',
|
2949 |
+
'label' => 'Advanced',
|
2950 |
+
'name' => '',
|
2951 |
+
'type' => 'tab',
|
2952 |
+
'instructions' => '',
|
2953 |
+
'required' => 0,
|
2954 |
+
'conditional_logic' => 0,
|
2955 |
+
'wrapper' => array(
|
2956 |
+
'width' => '',
|
2957 |
+
'class' => '',
|
2958 |
+
'id' => '',
|
2959 |
+
),
|
2960 |
+
'acfe_permissions' => '',
|
2961 |
+
'placement' => 'top',
|
2962 |
+
'endpoint' => 0,
|
2963 |
+
),
|
2964 |
+
array(
|
2965 |
+
'key' => 'field_acfe_form_term_advanced_load',
|
2966 |
+
'label' => 'Change values source',
|
2967 |
+
'name' => 'acfe_form_term_advanced_load',
|
2968 |
+
'type' => 'acfe_dynamic_message',
|
2969 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
2970 |
+
'instructions' => 'Dynamically alter the term ID where meta values are loaded from',
|
2971 |
+
'required' => 0,
|
2972 |
+
'conditional_logic' => 0,
|
2973 |
+
'wrapper' => array(
|
2974 |
+
'width' => '',
|
2975 |
+
'class' => '',
|
2976 |
+
'id' => '',
|
2977 |
+
),
|
2978 |
+
'acfe_permissions' => '',
|
2979 |
+
),
|
2980 |
+
array(
|
2981 |
+
'key' => 'field_acfe_form_term_advanced_save_args',
|
2982 |
+
'label' => 'Change term arguments',
|
2983 |
+
'name' => 'acfe_form_term_advanced_save_args',
|
2984 |
+
'type' => 'acfe_dynamic_message',
|
2985 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
2986 |
+
'instructions' => 'Dynamically alter the term arguments before database insert/update',
|
2987 |
+
'required' => 0,
|
2988 |
+
'conditional_logic' => 0,
|
2989 |
+
'wrapper' => array(
|
2990 |
+
'width' => '',
|
2991 |
+
'class' => '',
|
2992 |
+
'id' => '',
|
2993 |
+
),
|
2994 |
+
'acfe_permissions' => '',
|
2995 |
+
),
|
2996 |
+
array(
|
2997 |
+
'key' => 'field_acfe_form_term_advanced_save',
|
2998 |
+
'label' => 'Add custom action on term save',
|
2999 |
+
'name' => 'acfe_form_term_advanced_save',
|
3000 |
+
'type' => 'acfe_dynamic_message',
|
3001 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
3002 |
+
'instructions' => 'This action allows you to hook in before or after the meta data have been saved',
|
3003 |
+
'required' => 0,
|
3004 |
+
'conditional_logic' => 0,
|
3005 |
+
'wrapper' => array(
|
3006 |
+
'width' => '',
|
3007 |
+
'class' => '',
|
3008 |
+
'id' => '',
|
3009 |
+
),
|
3010 |
+
'acfe_permissions' => '',
|
3011 |
+
),
|
3012 |
),
|
3013 |
'min' => '',
|
3014 |
'max' => '',
|
3065 |
'return_format' => 'value',
|
3066 |
'save_other_choice' => 0,
|
3067 |
),
|
3068 |
+
array(
|
3069 |
+
'key' => 'field_acfe_form_user_custom_alias',
|
3070 |
+
'label' => 'Action alias',
|
3071 |
+
'name' => 'acfe_form_custom_alias',
|
3072 |
+
'type' => 'acfe_slug',
|
3073 |
+
'instructions' => '',
|
3074 |
+
'required' => 0,
|
3075 |
+
'conditional_logic' => 0,
|
3076 |
+
'wrapper' => array(
|
3077 |
+
'width' => '',
|
3078 |
+
'class' => '',
|
3079 |
+
'id' => '',
|
3080 |
+
),
|
3081 |
+
'hide_admin' => 0,
|
3082 |
+
'acfe_permissions' => '',
|
3083 |
+
'default_value' => '',
|
3084 |
+
'placeholder' => 'my-user-action',
|
3085 |
+
'prepend' => '',
|
3086 |
+
'append' => '',
|
3087 |
+
'maxlength' => '',
|
3088 |
+
),
|
3089 |
array(
|
3090 |
'key' => 'field_acfe_form_user_save_target',
|
3091 |
'label' => 'Target',
|
3142 |
),
|
3143 |
'acfe_permissions' => '',
|
3144 |
'layout' => 'block',
|
3145 |
+
'acfe_seemless_style' => true,
|
3146 |
'acfe_group_modal' => 0,
|
3147 |
'sub_fields' => array(
|
3148 |
array(
|
3245 |
),
|
3246 |
'acfe_permissions' => '',
|
3247 |
'layout' => 'block',
|
3248 |
+
'acfe_seemless_style' => true,
|
3249 |
'acfe_group_modal' => 0,
|
3250 |
'sub_fields' => array(
|
3251 |
array(
|
3348 |
),
|
3349 |
'acfe_permissions' => '',
|
3350 |
'layout' => 'block',
|
3351 |
+
'acfe_seemless_style' => true,
|
3352 |
'acfe_group_modal' => 0,
|
3353 |
'sub_fields' => array(
|
3354 |
array(
|
3452 |
),
|
3453 |
'acfe_permissions' => '',
|
3454 |
'layout' => 'block',
|
3455 |
+
'acfe_seemless_style' => true,
|
3456 |
'acfe_group_modal' => 0,
|
3457 |
'sub_fields' => array(
|
3458 |
array(
|
3555 |
),
|
3556 |
'acfe_permissions' => '',
|
3557 |
'layout' => 'block',
|
3558 |
+
'acfe_seemless_style' => true,
|
3559 |
'acfe_group_modal' => 0,
|
3560 |
'sub_fields' => array(
|
3561 |
array(
|
3658 |
),
|
3659 |
'acfe_permissions' => '',
|
3660 |
'layout' => 'block',
|
3661 |
+
'acfe_seemless_style' => true,
|
3662 |
'acfe_group_modal' => 0,
|
3663 |
'sub_fields' => array(
|
3664 |
array(
|
3761 |
),
|
3762 |
'acfe_permissions' => '',
|
3763 |
'layout' => 'block',
|
3764 |
+
'acfe_seemless_style' => true,
|
3765 |
'acfe_group_modal' => 0,
|
3766 |
'sub_fields' => array(
|
3767 |
array(
|
3864 |
),
|
3865 |
'acfe_permissions' => '',
|
3866 |
'layout' => 'block',
|
3867 |
+
'acfe_seemless_style' => true,
|
3868 |
'acfe_group_modal' => 0,
|
3869 |
'sub_fields' => array(
|
3870 |
array(
|
3967 |
),
|
3968 |
'acfe_permissions' => '',
|
3969 |
'layout' => 'block',
|
3970 |
+
'acfe_seemless_style' => true,
|
3971 |
'acfe_group_modal' => 0,
|
3972 |
'sub_fields' => array(
|
3973 |
array(
|
4499 |
'placeholder' => 'Default',
|
4500 |
'ajax' => 0,
|
4501 |
),
|
4502 |
+
array(
|
4503 |
+
'key' => 'field_acfe_form_user_tab_advanced',
|
4504 |
+
'label' => 'Advanced',
|
4505 |
+
'name' => '',
|
4506 |
+
'type' => 'tab',
|
4507 |
+
'instructions' => '',
|
4508 |
+
'required' => 0,
|
4509 |
+
'conditional_logic' => 0,
|
4510 |
+
'wrapper' => array(
|
4511 |
+
'width' => '',
|
4512 |
+
'class' => '',
|
4513 |
+
'id' => '',
|
4514 |
+
),
|
4515 |
+
'acfe_permissions' => '',
|
4516 |
+
'placement' => 'top',
|
4517 |
+
'endpoint' => 0,
|
4518 |
+
),
|
4519 |
+
array(
|
4520 |
+
'key' => 'field_acfe_form_user_advanced_load',
|
4521 |
+
'label' => 'Change values source',
|
4522 |
+
'name' => 'acfe_form_user_advanced_load',
|
4523 |
+
'type' => 'acfe_dynamic_message',
|
4524 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
4525 |
+
'instructions' => 'Dynamically alter the user ID where meta values are loaded from',
|
4526 |
+
'required' => 0,
|
4527 |
+
'conditional_logic' => 0,
|
4528 |
+
'wrapper' => array(
|
4529 |
+
'width' => '',
|
4530 |
+
'class' => '',
|
4531 |
+
'id' => '',
|
4532 |
+
),
|
4533 |
+
'acfe_permissions' => '',
|
4534 |
+
),
|
4535 |
+
array(
|
4536 |
+
'key' => 'field_acfe_form_user_advanced_save_args',
|
4537 |
+
'label' => 'Change user arguments',
|
4538 |
+
'name' => 'acfe_form_user_advanced_save_args',
|
4539 |
+
'type' => 'acfe_dynamic_message',
|
4540 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
4541 |
+
'instructions' => 'Dynamically alter the user arguments before database insert/update',
|
4542 |
+
'required' => 0,
|
4543 |
+
'conditional_logic' => 0,
|
4544 |
+
'wrapper' => array(
|
4545 |
+
'width' => '',
|
4546 |
+
'class' => '',
|
4547 |
+
'id' => '',
|
4548 |
+
),
|
4549 |
+
'acfe_permissions' => '',
|
4550 |
+
),
|
4551 |
+
array(
|
4552 |
+
'key' => 'field_acfe_form_user_advanced_save',
|
4553 |
+
'label' => 'Add custom action on user save',
|
4554 |
+
'name' => 'acfe_form_user_advanced_save',
|
4555 |
+
'type' => 'acfe_dynamic_message',
|
4556 |
+
'value' => isset($_REQUEST['post']) ? $_REQUEST['post'] : '',
|
4557 |
+
'instructions' => 'This action allows you to hook in before or after the meta data have been saved',
|
4558 |
+
'required' => 0,
|
4559 |
+
'conditional_logic' => 0,
|
4560 |
+
'wrapper' => array(
|
4561 |
+
'width' => '',
|
4562 |
+
'class' => '',
|
4563 |
+
'id' => '',
|
4564 |
+
),
|
4565 |
+
'acfe_permissions' => '',
|
4566 |
+
),
|
4567 |
),
|
4568 |
'min' => '',
|
4569 |
'max' => '',
|
includes/modules/form/form-front.php
CHANGED
@@ -24,12 +24,9 @@ class acfe_form_front{
|
|
24 |
if(!acfe_form_is_front())
|
25 |
return;
|
26 |
|
27 |
-
|
28 |
-
return;
|
29 |
-
|
30 |
-
$form = json_decode(acf_decrypt($_POST['_acf_form']), true);
|
31 |
|
32 |
-
if(
|
33 |
return;
|
34 |
|
35 |
$post_id = acf_maybe_get($form, 'post_id', false);
|
@@ -50,8 +47,7 @@ class acfe_form_front{
|
|
50 |
acf_setup_meta($_POST['acf'], 'acfe_form_validation', true);
|
51 |
|
52 |
do_action('acfe/form/validation', $form, $post_id);
|
53 |
-
do_action('acfe/form/validation/
|
54 |
-
do_action('acfe/form/validation/id=' . $form_id, $form, $post_id);
|
55 |
|
56 |
acf_reset_meta('acfe_form_validation');
|
57 |
|
@@ -63,12 +59,9 @@ class acfe_form_front{
|
|
63 |
if(!acf_verify_nonce('acfe_form'))
|
64 |
return;
|
65 |
|
66 |
-
|
67 |
-
return;
|
68 |
-
|
69 |
-
$form = json_decode(acf_decrypt($_POST['_acf_form']), true);
|
70 |
|
71 |
-
if(
|
72 |
return;
|
73 |
|
74 |
// ACF
|
@@ -112,20 +105,28 @@ class acfe_form_front{
|
|
112 |
// Custom Action
|
113 |
if($action === 'custom'){
|
114 |
|
115 |
-
$
|
|
|
|
|
|
|
116 |
|
117 |
}
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
endwhile;
|
124 |
endif;
|
125 |
|
126 |
do_action('acfe/form/submit', $form, $post_id);
|
127 |
-
do_action('acfe/form/submit/
|
128 |
-
do_action('acfe/form/submit/id=' . $form_id, $form, $post_id);
|
129 |
|
130 |
acf_reset_meta('acfe_form_submit');
|
131 |
|
@@ -289,7 +290,8 @@ class acfe_form_front{
|
|
289 |
$defaults['field_el'] = get_field('acf-field_acfe_form_form_field_el', $form_id);
|
290 |
$defaults['instruction_placement'] = get_field('acfe_form_instruction_placement', $form_id);
|
291 |
|
292 |
-
|
|
|
293 |
|
294 |
// Override
|
295 |
if(!empty($args['fields_attributes']['class']))
|
@@ -307,6 +309,10 @@ class acfe_form_front{
|
|
307 |
if(!empty($args['errors_class']))
|
308 |
$args['form_attributes']['data-errors-class'] = $args['errors_class'];
|
309 |
|
|
|
|
|
|
|
|
|
310 |
// Load
|
311 |
if(have_rows('acfe_form_actions', $form_id)):
|
312 |
while(have_rows('acfe_form_actions', $form_id)): the_row();
|
@@ -319,19 +325,15 @@ class acfe_form_front{
|
|
319 |
$action = get_sub_field('acfe_form_custom_action');
|
320 |
|
321 |
}
|
|
|
|
|
322 |
|
323 |
-
$args = apply_filters('acfe/form/load/
|
324 |
-
$args = apply_filters('acfe/form/load/
|
325 |
-
$args = apply_filters('acfe/form/load/action/' . $action . '/id=' . $form_id, $args, $args['post_id']);
|
326 |
|
327 |
endwhile;
|
328 |
endif;
|
329 |
|
330 |
-
// Args
|
331 |
-
$args = apply_filters('acfe/form/load', $args, $args['post_id']);
|
332 |
-
$args = apply_filters('acfe/form/load/name=' . $form_name, $args, $args['post_id']);
|
333 |
-
$args = apply_filters('acfe/form/load/id=' . $form_id, $args, $args['post_id']);
|
334 |
-
|
335 |
return $args;
|
336 |
|
337 |
}
|
24 |
if(!acfe_form_is_front())
|
25 |
return;
|
26 |
|
27 |
+
$form = acfe_form_decrypt_args();
|
|
|
|
|
|
|
28 |
|
29 |
+
if(!$form)
|
30 |
return;
|
31 |
|
32 |
$post_id = acf_maybe_get($form, 'post_id', false);
|
47 |
acf_setup_meta($_POST['acf'], 'acfe_form_validation', true);
|
48 |
|
49 |
do_action('acfe/form/validation', $form, $post_id);
|
50 |
+
do_action('acfe/form/validation/form=' . $form_name, $form, $post_id);
|
|
|
51 |
|
52 |
acf_reset_meta('acfe_form_validation');
|
53 |
|
59 |
if(!acf_verify_nonce('acfe_form'))
|
60 |
return;
|
61 |
|
62 |
+
$form = acfe_form_decrypt_args();
|
|
|
|
|
|
|
63 |
|
64 |
+
if(!$form)
|
65 |
return;
|
66 |
|
67 |
// ACF
|
105 |
// Custom Action
|
106 |
if($action === 'custom'){
|
107 |
|
108 |
+
$custom_action = get_sub_field('acfe_form_custom_action');
|
109 |
+
|
110 |
+
do_action('acfe/form/submit/' . $custom_action, $form, $post_id);
|
111 |
+
do_action('acfe/form/submit/' . $custom_action . '/form=' . $form_name, $form, $post_id);
|
112 |
|
113 |
}
|
114 |
|
115 |
+
// ACFE Actions
|
116 |
+
else{
|
117 |
+
|
118 |
+
$alias = get_sub_field('acfe_form_custom_alias');
|
119 |
+
|
120 |
+
do_action('acfe/form/prepare/' . $action, $form, $post_id, $alias);
|
121 |
+
do_action('acfe/form/prepare/' . $action . '/form=' . $form_name, $form, $post_id, $alias);
|
122 |
+
|
123 |
+
}
|
124 |
|
125 |
endwhile;
|
126 |
endif;
|
127 |
|
128 |
do_action('acfe/form/submit', $form, $post_id);
|
129 |
+
do_action('acfe/form/submit/form=' . $form_name, $form, $post_id);
|
|
|
130 |
|
131 |
acf_reset_meta('acfe_form_submit');
|
132 |
|
290 |
$defaults['field_el'] = get_field('acf-field_acfe_form_form_field_el', $form_id);
|
291 |
$defaults['instruction_placement'] = get_field('acfe_form_instruction_placement', $form_id);
|
292 |
|
293 |
+
//$args = wp_parse_args($param, $defaults);
|
294 |
+
$args = $defaults;
|
295 |
|
296 |
// Override
|
297 |
if(!empty($args['fields_attributes']['class']))
|
309 |
if(!empty($args['errors_class']))
|
310 |
$args['form_attributes']['data-errors-class'] = $args['errors_class'];
|
311 |
|
312 |
+
// Args
|
313 |
+
$args = apply_filters('acfe/form/load', $args, $args['post_id']);
|
314 |
+
$args = apply_filters('acfe/form/load/form=' . $form_name, $args, $args['post_id']);
|
315 |
+
|
316 |
// Load
|
317 |
if(have_rows('acfe_form_actions', $form_id)):
|
318 |
while(have_rows('acfe_form_actions', $form_id)): the_row();
|
325 |
$action = get_sub_field('acfe_form_custom_action');
|
326 |
|
327 |
}
|
328 |
+
|
329 |
+
$alias = get_sub_field('acfe_form_custom_alias');
|
330 |
|
331 |
+
$args = apply_filters('acfe/form/load/' . $action, $args, $args['post_id'], $alias);
|
332 |
+
$args = apply_filters('acfe/form/load/' . $action . '/form=' . $form_name, $args, $args['post_id'], $alias);
|
|
|
333 |
|
334 |
endwhile;
|
335 |
endif;
|
336 |
|
|
|
|
|
|
|
|
|
|
|
337 |
return $args;
|
338 |
|
339 |
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: acf, custom fields, meta, admin, fields, form, repeater, content
|
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.2
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 0.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -163,6 +163,9 @@ Display a modern Link Selection in a modal. Add custom fields using `filter('acf
|
|
163 |
* **New Field: Button**
|
164 |
Display a custom submit or button. Built-in ajax call on click. Example available in the field administration
|
165 |
|
|
|
|
|
|
|
166 |
* **New Field: Columns**
|
167 |
Re-arrange fields administration using columns
|
168 |
|
@@ -191,7 +194,7 @@ A slug text input (ie: `my-text-input`)
|
|
191 |
Select any taxonomy (format: checkbox, radio or select)
|
192 |
|
193 |
* **New Field: Taxonomy Terms selection**
|
194 |
-
Select any terms of any taxonomies (format: checkbox or select)
|
195 |
|
196 |
* **New Field: User roles selection**
|
197 |
Select any user role (format: checkbox, radio or select)
|
@@ -601,6 +604,28 @@ function my_acfe_modules(){
|
|
601 |
|
602 |
== Changelog ==
|
603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
= 0.8.1 =
|
605 |
* Field: Advanced Link - Added instructions to add custom fields in the field administration
|
606 |
* Field: Advanced Link - Added filters `acfe/fields/advanced_link/fields/name=my_field` & `acfe/fields/advanced_link/fields/key=field_xxxxxxx`
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.2
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 0.8.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
163 |
* **New Field: Button**
|
164 |
Display a custom submit or button. Built-in ajax call on click. Example available in the field administration
|
165 |
|
166 |
+
* **New Field: Code Editor**
|
167 |
+
Edit code using the native WP Core Codemirror library
|
168 |
+
|
169 |
* **New Field: Columns**
|
170 |
Re-arrange fields administration using columns
|
171 |
|
194 |
Select any taxonomy (format: checkbox, radio or select)
|
195 |
|
196 |
* **New Field: Taxonomy Terms selection**
|
197 |
+
Select any terms of any taxonomies, allow specific terms, level or childs (format: checkbox or select)
|
198 |
|
199 |
* **New Field: User roles selection**
|
200 |
Select any user role (format: checkbox, radio or select)
|
604 |
|
605 |
== Changelog ==
|
606 |
|
607 |
+
= 0.8.2 =
|
608 |
+
* Dynamic Forms: Fixed error position 'below' not working on some specific fields (Select)
|
609 |
+
* Dynamic Forms: `acfe_form_is_front()` & `acfe_form_is_admin()` helpers now also check native ACF Form screen
|
610 |
+
* Dynamic Forms: Added action alias name setting for each action allowing better targeting when using hooks
|
611 |
+
* Dynamic Forms: Reworked forms actions hooks and added 'Advanced' tab for each action with code examples
|
612 |
+
* Field: Groups/Clones - CSS integration tweaks are now optional (Thanks @Brandon A.)
|
613 |
+
* Field: Groups/Clones - Added "Seemless style" setting which enable better CSS integration (remove borders and padding)
|
614 |
+
* Field: Code Editor - Added Field (use the WP Core CodeMirror script)
|
615 |
+
* Field: Taxonomy Terms - Added advanced settings allowing specific taxonomies or specific terms in the field (with level or parent/child dependencies)
|
616 |
+
* Field: reCaptcha - Fixed a bug where reCaptcha would not work properly
|
617 |
+
* Field: Flexible Content - Updated JS filter `acf.doAction('acfe/fields/flexible_content/preview', response, flexible.$el, $layout, ajaxData)` & moved it after preview HTML parse
|
618 |
+
* Field: Flexible Content - Updated JS filters & added variations `acf.doAction('acfe/fields/flexible_content/preview/name=my_flexible&layout=my_layout', response, flexible.$el, $layout, ajaxData)`
|
619 |
+
* Field: Flexible Content - Fixed "Remove Collapse" setting not working on newly added layout (Moved RemoveCollapse from acf-extended-fc-control.js to acf-extended-fc.js (acfe/flexible/layouts))
|
620 |
+
* Fields: Fields are now registered using `acf_register_field_type()`. This will allow developers to use `acf_get_field_type('acfe_field')`
|
621 |
+
* Fields settings: Bidirectional - Added filter which allow to force related field to be updated when migrating from already existant values
|
622 |
+
* Fields settings: Bidirectional - Added `filter('acfe/bidirectional/force_update/name=my_field', true, $field, $post_id)` (available with /type & /key) (Feature request: @anjanphukan)
|
623 |
+
* Field Groups: Fixed CSS which wrongly hide instructions when there's no field label (Thanks @Damien C.)
|
624 |
+
* Field Groups: Third Party - Added PHP filter to change source column output `filter('acfe/field_groups_third_party/source', $source, $post_id, $field_group)`
|
625 |
+
* General: Added `filter('acfe/field_wrapper_attributes/type=$field_type', $wrapper, $field)` (also with /name & /key variations)
|
626 |
+
* General: Splitted CSS for front-end/back-end
|
627 |
+
* General: Fixed ACF Setting Tab "Module: Taxonomies Enhancements" title (thanks @doublesharp)
|
628 |
+
|
629 |
= 0.8.1 =
|
630 |
* Field: Advanced Link - Added instructions to add custom fields in the field administration
|
631 |
* Field: Advanced Link - Added filters `acfe/fields/advanced_link/fields/name=my_field` & `acfe/fields/advanced_link/fields/key=field_xxxxxxx`
|