PluginProbe
Advanced Custom Fields: Extended / 0.8.7.2
Advanced Custom Fields: Extended v0.8.7.2
0.9.2.7 0.9.2.6 0.9.2.5 0.8.6 0.8.6.1 0.8.6.3 0.8.6.5 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.8 0.8.8.1 0.8.8.10 0.8.8.11 0.8.8.2 0.8.8.3 0.8.8.4 All 92 releases
acf-extended / includes / admin / settings.php
settings.php
453 lines 26.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if(!defined('ABSPATH'))
4 exit;
5
6 add_action('admin_menu', 'acfe_admin_settings_menu');
7 function acfe_admin_settings_menu(){
8
9 if(!acf_get_setting('show_admin'))
10 return;
11
12 $submenu_page = add_submenu_page('edit.php?post_type=acf-field-group', __('Settings'), __('Settings'), acf_get_setting('capability'), 'acfe-settings', 'acfe_admin_settings_html');
13
14 add_action('admin_print_scripts-' . $submenu_page, function(){
15 acf_enqueue_scripts();
16 });
17
18 }
19
20 function acfe_admin_settings_html(){
21 ?>
22 <div class="wrap" id="acfe-admin-settings">
23
24 <h1><?php _e('Settings'); ?></h1>
25
26 <div id="poststuff">
27
28 <div class="postbox acf-postbox">
29 <div class="postbox-header">
30 <h2 class="hndle ui-sortable-handle"><span><?php _e('Settings'); ?></span></h2>
31 </div>
32 <div class="inside acf-fields -left">
33
34 <?php
35 acf_render_field_wrap(array(
36 'type' => 'tab',
37 'label' => 'ACF',
38 ));
39 ?>
40
41 <?php
42
43 $settings = array(
44 array(
45 'name' => 'path',
46 'label' => 'Path',
47 'value' => '<code>' . acf_get_setting('path') . '</code>',
48 'description' => 'Absolute path to ACF plugin folder including trailing slash.<br />Defaults to plugin_dir_path'
49 ),
50 array(
51 'name' => 'dir',
52 'label' => 'Directory',
53 'value' => '<code>' . acf_get_setting('dir') . '</code>',
54 'description' => 'URL to ACF plugin folder including trailing slash. Defaults to plugin_dir_url'
55 ),
56 array(
57 'name' => 'show_admin',
58 'label' => 'Show menu',
59 'value' => '<code>' . (acf_get_setting('show_admin') ? __('True'): __('False')) . '</code>',
60 'description' => 'Show/hide ACF menu item. Defaults to true'
61 ),
62 array(
63 'name' => 'stripslashes',
64 'label' => 'Strip slashes',
65 'value' => '<code>' . (acf_get_setting('stripslashes') ? __('True'): __('False')) . '</code>',
66 'description' => 'Runs the function stripslashes on all $_POST data. Some servers / WP instals may require this extra functioanlity. Defaults to false'
67 ),
68 array(
69 'name' => 'local',
70 'label' => 'PHP/Json',
71 'value' => '<code>' . (acf_get_setting('local') ? __('True'): __('False')) . '</code>',
72 'description' => 'Enable/Disable local (PHP/json) fields. Defaults to true'
73 ),
74 array(
75 'name' => 'json',
76 'label' => 'Json',
77 'value' => '<code>' . (acf_get_setting('json') ? __('True'): __('False')) . '</code>',
78 'description' => 'Enable/Disable json fields. Defaults to true'
79 ),
80 array(
81 'name' => 'save_json',
82 'label' => 'Json folder (save)',
83 'value' => '<code>' . acf_get_setting('save_json') . '</code>',
84 'description' => 'Absolute path to folder where json files will be created when field groups are saved.<br />Defaults to ‘acf-json’ folder within current theme'
85 ),
86 array(
87 'name' => 'load_json',
88 'label' => 'Json folder (load)',
89 'value' => '<code>' . implode("<br />", (array) acf_get_setting('load_json')) . '</code>',
90 'description' => 'Array of absolutes paths to folders where field group json files can be read.<br />Defaults to an array containing at index 0, the ‘acf-json’ folder within current theme'
91 ),
92 array(
93 'name' => 'default_language',
94 'label' => 'Default language',
95 'value' => '<code>' . acf_get_setting('default_language') . '</code>',
96 'description' => 'Language code of the default language. Defaults to ”.<br />If WPML is active, ACF will default this to the WPML default language setting'
97 ),
98 array(
99 'name' => 'current_language',
100 'label' => 'Current language',
101 'value' => '<code>' . acf_get_setting('current_language') . '</code>',
102 'description' => 'Language code of the current post’s language. Defaults to ”.<br />If WPML is active, ACF will default this to the WPML current language'
103 ),
104 array(
105 'name' => 'capability',
106 'label' => 'Capability',
107 'value' => '<code>' . acf_get_setting('capability') . '</code>',
108 'description' => 'Capability used for ACF post types and if the current user can see the ACF menu item.<br />Defaults to ‘manage_options’.'
109 ),
110 array(
111 'name' => 'show_updates',
112 'label' => 'Show updates',
113 'value' => '<code>' . (acf_get_setting('show_updates') ? __('True'): __('False')) . '</code>',
114 'description' => 'Enable/Disable updates to appear in plugin list and show/hide the ACF updates admin page.<br />Defaults to true.'
115 ),
116 array(
117 'name' => 'export_textdomain',
118 'label' => 'Export textdomain',
119 'value' => '<code>' . (acf_get_setting('export_textdomain') ? __('True'): __('False')) . '</code>',
120 'description' => 'Array of keys used during the ‘Export to PHP’ feature to wrap strings within the __() function.<br />Defaults to array(’title’, ’label’, ’instructions’). Depreciated in v5.3.4 – please see l10n_field and l10n_field_group'
121 ),
122 array(
123 'name' => 'export_translate',
124 'label' => 'Export translate',
125 'value' => '<code>' . print_r(acf_get_setting('export_translate'), true) . '</code>',
126 'description' => 'Used during the ‘Export to PHP’ feature to wrap strings within the __() function.<br />Depreciated in v5.4.4 – please see l10n_textdomain'
127 ),
128 array(
129 'name' => 'autoload',
130 'label' => 'Auto load',
131 'value' => '<code>' . (acf_get_setting('autoload') ? __('True'): __('False')) . '</code>',
132 'description' => 'Sets the text domain used when translating field and field group settings.<br />Defaults to ”. Strings will not be translated if this setting is empty'
133 ),
134 array(
135 'name' => 'l10n',
136 'label' => 'l10n',
137 'value' => '<code>' . (acf_get_setting('l10n') ? __('True'): __('False')) . '</code>',
138 'description' => 'Allows ACF to translate field and field group settings using the __() function.<br />Defaults to true. Useful to override translation without modifying the textdomain'
139 ),
140 array(
141 'name' => 'l10n_textdomain',
142 'label' => 'l10n Textdomain',
143 'value' => '<code>' . print_r(acf_get_setting('l10n_textdomain'), true) . '</code>',
144 'description' => 'Sets the text domain used when translating field and field group settings.<br />Defaults to ”. Strings will not be translated if this setting is empty'
145 ),
146 array(
147 'name' => 'l10n_field',
148 'label' => 'l10n Field',
149 'value' => '<code>' . print_r(acf_get_setting('l10n_field'), true) . '</code>',
150 'description' => 'An array of settings to translate when loading and exporting a field.<br />Defaults to array(’label’, ’instructions’). Depreciated in v5.3.6 – please see acf/translate_field filter'
151 ),
152 array(
153 'name' => 'l10n_field_group',
154 'label' => 'l10n Field group',
155 'value' => '<code>' . print_r(acf_get_setting('l10n_field_group'), true) . '</code>',
156 'description' => 'An array of settings to translate when loading and exporting a field group.<br />Defaults to array(’title’). Depreciated in v5.3.6 – please see acf/translate_field_group filter'
157 ),
158 array(
159 'name' => 'google_api_key',
160 'label' => 'Google API Key',
161 'value' => '<code>' . acf_get_setting('google_api_key') . '</code>',
162 'description' => 'Specify a Google Maps API authentication key to prevent usage limits.<br />Defaults to ”'
163 ),
164 array(
165 'name' => 'google_api_client',
166 'label' => 'Google API Key',
167 'value' => '<code>' . acf_get_setting('google_api_client') . '</code>',
168 'description' => 'Specify a Google Maps API Client ID to prevent usage limits.<br />Not needed if using <code>google_api_key</code>. Defaults to ”'
169 ),
170 array(
171 'name' => 'enqueue_google_maps',
172 'label' => 'Enqueue Google Maps',
173 'value' => '<code>' . (acf_get_setting('enqueue_google_maps') ? __('True'): __('False')) . '</code>',
174 'description' => 'Allows ACF to enqueue and load the Google Maps API JS library.<br />Defaults to true'
175 ),
176 array(
177 'name' => 'enqueue_select2',
178 'label' => 'Enqueue Select2',
179 'value' => '<code>' . (acf_get_setting('enqueue_select2') ? __('True'): __('False')) . '</code>',
180 'description' => 'Allows ACF to enqueue and load the Select2 JS/CSS library.<br />Defaults to true'
181 ),
182 array(
183 'name' => 'select2_version',
184 'label' => 'Select2 version',
185 'value' => '<code>' . acf_get_setting('select2_version') . '</code>',
186 'description' => 'Defines which version of Select2 library to enqueue. Either 3 or 4.<br />Defaults to 4 since ACF 5.6.0'
187 ),
188 array(
189 'name' => 'enqueue_datepicker',
190 'label' => 'Enqueue Datepicker',
191 'value' => '<code>' . (acf_get_setting('enqueue_datepicker') ? __('True'): __('False')) . '</code>',
192 'description' => 'Allows ACF to enqueue and load the WP datepicker JS/CSS library.<br />Defaults to true'
193 ),
194 array(
195 'name' => 'enqueue_datetimepicker',
196 'label' => 'Enqueue Date/timepicker',
197 'value' => '<code>' . (acf_get_setting('enqueue_datetimepicker') ? __('True'): __('False')) . '</code>',
198 'description' => 'Allows ACF to enqueue and load the datetimepicker JS/CSS library.<br />Defaults to true'
199 ),
200 array(
201 'name' => 'row_index_offset',
202 'label' => 'Row index offset',
203 'value' => '<code>' . acf_get_setting('row_index_offset') . '</code>',
204 'description' => 'Defines the starting index used in all ‘loop’ and ‘row’ functions.<br />Defaults to 1 (1 is the first row), can be changed to 0 (0 is the first row)'
205 ),
206 array(
207 'name' => 'remove_wp_meta_box',
208 'label' => 'Remove WP meta box',
209 'value' => '<code>' . (acf_get_setting('remove_wp_meta_box') ? __('True'): __('False')) . '</code>',
210 'description' => 'Allows ACF to remove the default WP custom fields metabox. Defaults to true'
211 ),
212 );
213
214 ?>
215
216 <?php foreach($settings as $setting){ ?>
217 <div class="acf-field">
218 <div class="acf-label">
219 <label><span class="acf-js-tooltip dashicons dashicons-info" style="float:right; font-size:16px; color:#ccc;" title="<?php echo $setting['description']; ?>"></span><?php echo $setting['label']; ?></label>
220 <p class="description"><code><?php echo $setting['name']; ?></code></p>
221 </div>
222 <div class="acf-input">
223 <?php echo $setting['value']; ?>
224 </div>
225 </div>
226 <?php } ?>
227
228 <?php
229 acf_render_field_wrap(array(
230 'type' => 'tab',
231 'label' => 'ACF: Extended',
232 ));
233 ?>
234
235 <?php
236
237 $settings = array(
238
239 // Modules
240 array(
241 'name' => 'acfe/modules/author',
242 'label' => 'Module: Author',
243 'value' => '<code>' . (acf_get_setting('acfe/modules/author', true) ? __('True'): __('False')) . '</code>',
244 'description' => 'Show/hide the Author module. Defaults to true'
245 ),
246 array(
247 'name' => 'acfe/modules/categories',
248 'label' => 'Module: Categories',
249 'value' => '<code>' . (acf_get_setting('acfe/modules/categories', true) ? __('True'): __('False')) . '</code>',
250 'description' => 'Enable/disable the Field Group Categories taxonomy. Defaults to true'
251 ),
252 array(
253 'name' => 'acfe/modules/dynamic_block_types',
254 'label' => 'Module: Dynamic Block Types',
255 'value' => '<code>' . (acf_get_setting('acfe/modules/dynamic_block_types', true) ? __('True'): __('False')) . '</code>',
256 'description' => 'Show/hide the Block Types module. Defaults to true'
257 ),
258 array(
259 'name' => 'acfe/modules/dynamic_forms',
260 'label' => 'Module: Dynamic Forms',
261 'value' => '<code>' . (acf_get_setting('acfe/modules/dynamic_forms', true) ? __('True'): __('False')) . '</code>',
262 'description' => 'Show/hide the Forms module. Defaults to true'
263 ),
264 array(
265 'name' => 'acfe/modules/dynamic_post_types',
266 'label' => 'Module: Dynamic Post Types',
267 'value' => '<code>' . (acf_get_setting('acfe/modules/dynamic_post_types', true) ? __('True'): __('False')) . '</code>',
268 'description' => 'Show/hide the Post Types module. Defaults to true'
269 ),
270 array(
271 'name' => 'acfe/modules/dynamic_taxonomies',
272 'label' => 'Module: Dynamic Taxonomies',
273 'value' => '<code>' . (acf_get_setting('acfe/modules/dynamic_taxonomies', true) ? __('True'): __('False')) . '</code>',
274 'description' => 'Show/hide the Taxonomies module. Defaults to true'
275 ),
276 array(
277 'name' => 'acfe/modules/dynamic_options_pages',
278 'label' => 'Module: Dynamic Options Pages',
279 'value' => '<code>' . (acf_get_setting('acfe/modules/dynamic_options_pages', true) ? __('True'): __('False')) . '</code>',
280 'description' => 'Show/hide the Options Pages module. Defaults to true'
281 ),
282 array(
283 'name' => 'acfe/modules/multilang',
284 'label' => 'Module: Multilang',
285 'value' => '<code>' . (acf_get_setting('acfe/modules/multilang', true) ? __('True'): __('False')) . '</code>',
286 'description' => 'Enable/disable Multilang compatibility module for WPML & Polylang. Defaults to true'
287 ),
288 array(
289 'name' => 'acfe/modules/options',
290 'label' => 'Module: Options',
291 'value' => '<code>' . (acf_get_setting('acfe/modules/options', true) ? __('True'): __('False')) . '</code>',
292 'description' => 'Show/hide the Options module. Defaults to true'
293 ),
294 array(
295 'name' => 'acfe/modules/single_meta',
296 'label' => 'Module: Single Meta',
297 'value' => '<code>' . (acf_get_setting('acfe/modules/single_meta', true) ? __('True'): __('False')) . '</code>',
298 'description' => 'Enable/disable Single Meta Save module. Defaults to false'
299 ),
300 array(
301 'name' => 'acfe/modules/ui',
302 'label' => 'Module: UI Enhancements',
303 'value' => '<code>' . (acf_get_setting('acfe/modules/ui', true) ? __('True'): __('False')) . '</code>',
304 'description' => 'Show/hide the UI enhancements module. Defaults to true'
305 ),
306
307 // Recaptcha
308 array(
309 'name' => 'acfe/field/recaptcha/site_key',
310 'label' => 'Field: reCaptcha site key',
311 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/site_key') . '</code>',
312 'description' => 'The default reCaptcha site key'
313 ),
314 array(
315 'name' => 'acfe/field/recaptcha/secret_key',
316 'label' => 'Field: reCaptcha secret key',
317 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/secret_key') . '</code>',
318 'description' => 'The default reCaptcha secret key'
319 ),
320 array(
321 'name' => 'acfe/field/recaptcha/version',
322 'label' => 'Field: reCaptcha version',
323 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/version', 'v2') . '</code>',
324 'description' => 'The default reCaptcha version'
325 ),
326 array(
327 'name' => 'acfe/field/recaptcha/v2/theme',
328 'label' => 'Field: reCaptcha v2 theme',
329 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/v2/theme', 'light') . '</code>',
330 'description' => 'The default reCaptcha v2 theme'
331 ),
332 array(
333 'name' => 'acfe/field/recaptcha/v2/size',
334 'label' => 'Field: reCaptcha v2 size',
335 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/v2/size', 'normal') . '</code>',
336 'description' => 'The default reCaptcha v2 size'
337 ),
338 array(
339 'name' => 'acfe/field/recaptcha/v3/hide_logo',
340 'label' => 'Field: reCaptcha v3 hide logo',
341 'value' => '<code>' . acf_get_setting('acfe/field/recaptcha/v3/hide_logo') . '</code>',
342 'description' => 'Show/hide reCaptcha v3 logo'
343 ),
344 array(
345 'name' => 'acfe/dev',
346 'label' => 'Dev mode',
347 'value' => '<code>' . (acf_get_setting('acfe/dev') ? __('True'): __('False')) . '</code>',
348 'description' => 'Show/hide the advanced WP post meta box. Defaults to false'
349 ),
350
351 // PHP
352 array(
353 'name' => 'acfe/php',
354 'label' => 'PHP',
355 'value' => '<code>' . (acf_get_setting('acfe/php') ? __('True'): __('False')) . '</code>',
356 'description' => 'Whenever PHP AutoSync is enabled'
357 ),
358 array(
359 'name' => 'acfe/php_found',
360 'label' => 'PHP: Found',
361 'value' => '<code>' . (acf_get_setting('acfe/php_found') ? __('True'): __('False')) . '</code>',
362 'description' => 'Whenever PHP AutoSync folder has been found, based on acfe/php_load setting'
363 ),
364 array(
365 'name' => 'acfe/php_save',
366 'label' => 'PHP: Save',
367 'value' => '<code>' . acf_get_setting('acfe/php_save') . '</code>',
368 'description' => 'PHP AutoSync saving path'
369 ),
370 array(
371 'name' => 'acfe/php_load',
372 'label' => 'PHP: Load',
373 'value' => '<code>' . implode("<br />", (array) acf_get_setting('acfe/php_load')) . '</code>',
374 'description' => 'PHP AutoSync loading path'
375 ),
376
377 // Json
378 array(
379 'name' => 'acfe/json',
380 'label' => 'Json',
381 'value' => '<code>' . (acf_get_setting('acfe/json') ? __('True'): __('False')) . '</code>',
382 'description' => 'Whenever Json AutoSync is enabled'
383 ),
384 array(
385 'name' => 'acfe/json_found',
386 'label' => 'Json: Found',
387 'value' => '<code>' . (acf_get_setting('acfe/json_found') ? __('True'): __('False')) . '</code>',
388 'description' => 'Whenever Json AutoSync folder has been found, based on acfe/json_load setting'
389 ),
390 array(
391 'name' => 'acfe/json_save',
392 'label' => 'Json: Save',
393 'value' => '<code>' . acf_get_setting('acfe/json_save') . '</code>',
394 'description' => 'Json AutoSync saving path'
395 ),
396 array(
397 'name' => 'acfe/json_load',
398 'label' => 'Json: Load',
399 'value' => '<code>' . implode("<br />", (array) acf_get_setting('acfe/json_load')) . '</code>',
400 'description' => 'Json AutoSync loading paths'
401 ),
402
403 // Theme
404 array(
405 'name' => 'acfe/theme_path',
406 'label' => 'Theme: Path',
407 'value' => '<code>' . acf_get_setting('acfe/theme_path') . '</code>',
408 'description' => 'Detected Theme Path'
409 ),
410 array(
411 'name' => 'acfe/theme_url',
412 'label' => 'Theme: URL',
413 'value' => '<code>' . acf_get_setting('acfe/theme_url') . '</code>',
414 'description' => 'Detected Theme URL'
415 ),
416 array(
417 'name' => 'acfe/theme_folder',
418 'label' => 'Theme: Folder',
419 'value' => '<code>' . acf_get_setting('acfe/theme_folder') . '</code>',
420 'description' => 'Detected Theme Folder'
421 ),
422 );
423 ?>
424
425 <?php foreach($settings as $setting){ ?>
426 <div class="acf-field">
427 <div class="acf-label">
428 <label><span class="acf-js-tooltip dashicons dashicons-info" style="float:right; font-size:16px; color:#ccc;" title="<?php echo $setting['description']; ?>"></span><?php echo $setting['label']; ?></label>
429 <p class="description"><code><?php echo $setting['name']; ?></code></p>
430 </div>
431 <div class="acf-input">
432 <?php echo $setting['value']; ?>
433 </div>
434 </div>
435 <?php } ?>
436
437 <script type="text/javascript">
438 if( typeof acf !== 'undefined' ) {
439
440 acf.newPostbox({
441 'id': 'acfe-settings',
442 'label': 'left'
443 });
444
445 }
446 </script>
447 </div>
448 </div>
449 </div>
450
451 </div>
452 <?php
453 }