PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / Productivity.php

Productivity.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.0, at Inc/Admin/Options/Productivity.php

694 lines 24.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\Options\Productivity\Duplicate_Post;
7 use WPAdminify\Inc\Admin\Options\Productivity\PostTypesOrder;
8 use WPAdminify\Inc\Admin\AdminSettingsModel;
9
10
11 if (!defined('ABSPATH')) {
12 die;
13 } // Cannot access directly.
14
15 if (!class_exists('Productivity')) {
16 class Productivity extends AdminSettingsModel
17 {
18 public function __construct()
19 {
20 $this->productivity_settings();
21 }
22
23 protected function get_defaults()
24 {
25 return [
26 // Admin Notices
27 'hide_notices' => false,
28 'hide_notices_non_admin' => false,
29 'other_notices' => [],
30 'screen_help_tab' => [
31 'enable_for_screen' => false,
32 'screen_help_data' => []
33 ],
34
35 'media_attachments' => [
36 'enable_media' => false,
37 // 'media_ininite_scroll' => false,
38 'thumbnails_rss_feed' => false,
39 // 'allowed_upload_files' => [],
40 // 'convert_to_webp' => false,
41 // 'featured_to_post' => false,
42 // 'media_lowercase' => false,
43 ],
44 'folders' => [
45 'enable_folders' => false,
46 'enable_for' => [ 'post', 'page' ],
47 'media' => false,
48 ],
49 'admin_pages' => false,
50 'post_types_order' => [
51 'enable_pto' => false,
52 'pto_taxonomies' => [],
53 'pto_posts' => [ 'page' ],
54 'pto_media' => false,
55 ],
56 'menu_duplicator' => false,
57 'post_duplicator' => [
58 'enable_post_duplicator' => false,
59 'post_types' => ['page'],
60 'taxonomies' => [],
61 ],
62 // Post Columns
63 'custom_admin_columns' => [
64 'enable' => false,
65 'post_page_column_thumb_image' => [],
66 'columns_data' => []
67 ],
68
69 // Sidebar Widgets
70 'remove_widgets' => [
71 'remove_widgets_type' => 'sidebar',
72 'disable_gutenberg_editor' => false,
73 'sidebar_widgets_list' => [],
74 'dashboard_widgets_list' => [],
75 // 'sidebar_widgets_user_roles' => [],
76 ],
77 ];
78 }
79
80
81 /**
82 * Admin Notices: Settings
83 */
84 public function admin_notices_settings(&$fields)
85 {
86 $fields[] = [
87 'id' => 'productivity_sub_heading',
88 'type' => 'subheading',
89 'content' => Utils::adminfiy_help_urls(
90 __('<span></span>', 'adminify'),
91 'https://wpadminify.com/kb/productivity/',
92 '',
93 'https://www.facebook.com/groups/jeweltheme',
94 'https://wpadminify.com/support/'
95 ),
96 ];
97
98 $fields[] = [
99 'id' => 'hide_notices',
100 'type' => 'switcher',
101 'title' => sprintf(__('Hide "Admin Notices"? %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
102 'subtitle' => __('Hide Admin Notices to make your Dashboard Clean. ', 'adminify'),
103 'class' => 'adminify-pro-fieldset adminify-pro-notice',
104 'text_on' => __('Yes', 'adminify'),
105 'text_off' => __('No', 'adminify'),
106 'text_width' => 80,
107 'default' => $this->get_default_field('hide_notices'),
108 ];
109 $fields[] = [
110 'id' => 'hide_notices_non_admin',
111 'type' => 'checkbox',
112 'label' => sprintf(__('Also, Hide for Non-Admin Users? %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
113 'title' => ' ',
114 'default' => $this->get_default_field('hide_notices_non_admin'),
115 'dependency' => ['hide_notices', '==', 'true', 'true'],
116 ];
117
118 $other_notices_data = [
119 'welcome_panel' => sprintf(__('Remove Welcome Panel %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
120 'php_nag' => sprintf(__('Remove "PHP Update Required" Notice %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
121 'core_update_notice' => sprintf(__('Hide Core Update Notice %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
122 'plugin_update_notice' => sprintf(__('Hide Plugin Update Notice %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
123 'theme_update_notice' => sprintf(__('Hide Theme Update Notice %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
124 'site_health' => sprintf(__('Disable Site Health checks %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
125 ];
126
127 $fields[] = [
128 'id' => 'other_notices',
129 'type' => 'checkbox',
130 'title' => sprintf(__('Other Notices %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
131 'subtitle' => __('Show/Remove Dashboard Welcome Panel, Hide WordPress Themes,Plugins,Core Update Notices', 'adminify'),
132 'options' => $other_notices_data,
133 'default' => $this->get_default_field('other_notices'),
134 'dependency' => ['hide_notices', '==', 'true', 'true'],
135 ];
136 }
137
138
139 /**
140 * Screen & Help Tab
141 */
142 public function screen_options(&$fields)
143 {
144 $screen_options_settings = [
145 'hide_screen_options' => sprintf(__('Hide Screen Options %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
146 'hide_help_tab' => sprintf(__('Hide Help Tab %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
147 ];
148
149 $fields[] = [
150 'id' => 'screen_help_tab',
151 'title' => sprintf(__('Screen Options and Help Tab %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
152 'subtitle' => __('Screen Options and Help Tab', 'adminify'),
153 'type' => 'fieldset',
154 'fields' => [
155 [
156 'id' => 'enable_for_screen',
157 'type' => 'switcher',
158 'title' => __('', 'adminify'),
159 'class' => 'adminify-pl-0 adminify-pt-0 adminify-pro-feature',
160 'text_on' => __('Show', 'adminify'),
161 'text_off' => __('Hide', 'adminify'),
162 'text_width' => 80,
163 'default' => $this->get_default_field('screen_help_tab')['enable_for_screen'],
164 ],
165 [
166 'id' => 'screen_help_data',
167 'type' => 'checkbox',
168 'class' => 'adminify-one-col',
169 'title' => __('', 'adminify'),
170 'options' => $screen_options_settings,
171 'default' => $this->get_default_field('screen_help_tab')['screen_help_data'],
172 'dependency' => ['enable_for_screen', '==', 'true', 'true']
173 ]
174 ]
175 ];
176 }
177
178
179 /**
180 * Folders: Post Types Settings
181 */
182 public function folders_post_types_settings( &$fields ) {
183
184 $fields[] = [
185 'id' => 'folders',
186 'title' => __('Folders', 'adminify'),
187 'subtitle' => __('Folders for Posts/Pages/Custom Post Types etc.', 'adminify'),
188 'class' => 'adminify-two-columns',
189 'type' => 'fieldset',
190 'fields' => [
191 [
192 'id' => 'enable_folders',
193 'type' => 'switcher',
194 'title' => __('', 'adminify'),
195 'class' => 'adminify-pl-0',
196 'text_on' => __('Show', 'adminify'),
197 'text_off' => __('Hide', 'adminify'),
198 'text_width' => 80,
199 'default' => $this->get_default_field('folders')['enable_folders'],
200 ],
201 [
202 'id' => 'enable_for',
203 'type' => 'checkbox',
204 'title' => __('Enable for', 'adminify'),
205 'subtitle' => __('Select Post Types for enabling Folders', 'adminify'),
206 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
207 'default' => $this->get_default_field('folders')['enable_for'],
208 'dependency' => ['enable_folders', '==', 'true', 'true']
209 ],
210 [
211 'id' => 'media',
212 'type' => 'switcher',
213 'text_on' => __('Yes', 'adminify'),
214 'text_off' => __('No', 'adminify'),
215 'text_width' => 80,
216 'title' => __('Enable Media Folders', 'adminify'),
217 'subtitle' => __('Enabling Folders for Media Files', 'adminify'),
218 'default' => $this->get_default_field('folders')['media'],
219 'dependency' => ['enable_folders', '==', 'true', 'true']
220 ]
221
222 ],
223 ];
224
225 $fields[] = [
226 'id' => 'admin_pages',
227 'type' => 'switcher',
228 'title' => sprintf(__('Admin Pages %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
229 'class' => 'adminify-pro-notice adminify-pro-fieldset',
230 'text_on' => __('Yes', 'adminify'),
231 'text_off' => __('No', 'adminify'),
232 'text_width' => 80,
233 'subtitle' => __('Custom Admin Pages for Creating Top Level or Sub Level Menu. Supports all page builders - Gutenberg, Elementor, Bricks, Oxygen, Divi etc', 'adminify'),
234 'default' => $this->get_default_field('admin_pages'),
235 ];
236
237 }
238
239
240 /**
241 * Post Types Order: Options
242 */
243 public function post_types_order_options( &$fields ) {
244
245 $post_types_order_fieldset= [];
246 $post_types_order_fieldset[] = [
247 'id' => 'enable_pto',
248 'title' => __('', 'adminify'),
249 'class' => 'adminify-pl-0',
250 'type' => 'switcher',
251 'text_on' => __('Show', 'adminify'),
252 'text_off' => __('Hide', 'adminify'),
253 'text_width' => 80,
254 'default' => $this->get_default_field('post_types_order')['enable_pto'],
255 ];
256
257 $post_types_order_fieldset[] = [
258 'id' => 'pto_posts',
259 'type' => 'checkbox',
260 'title' => __( 'Sortable Post Types', 'adminify' ),
261 'subtitle' => __( 'Select Post Types for sorting', 'adminify' ),
262 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
263 'default' => $this->get_default_field('post_types_order')['pto_posts'],
264 'dependency' => ['enable_pto', '==', 'true', 'true'],
265 ];
266
267 $post_types_order_fieldset[] = [
268 'id' => 'pto_media',
269 'type' => 'switcher',
270 'title' => __( 'Sortable Media Files', 'adminify' ),
271 'subtitle' => __( 'Enable/Disable Sortable Media Files on List View', 'adminify' ),
272 'text_on' => __('Yes', 'adminify'),
273 'text_off' => __('No', 'adminify'),
274 'text_width' => 80,
275 'default' => $this->get_default_field('post_types_order')[ 'pto_media' ],
276 'dependency' => ['enable_pto', '==', 'true', 'true'],
277 ];
278
279 $post_types_order_fieldset[] = [
280 'id' => 'pto_taxonomies',
281 'type' => 'checkbox',
282 'title' => sprintf(__('Sortable Taxonomies %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
283 'subtitle' => __('Select for Sortable Taxonomies', 'adminify'),
284 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_taxonomies',
285 'query_args' => [
286 'orderby' => 'post_title',
287 'order' => 'ASC',
288 ],
289 'default' => $this->get_default_field('post_types_order')['pto_taxonomies'],
290 'dependency' => ['enable_pto', '==', 'true', 'true'],
291 ];
292
293
294 $fields[] = [
295 'id' => 'post_types_order',
296 'title' => __('Post Types Order', 'adminify'),
297 'subtitle' => __('Enable/Disable Post Types Orders to increase your productivity.', 'adminify'),
298 'type' => 'fieldset',
299 'fields' => $post_types_order_fieldset,
300 ];
301 }
302
303
304 public static function get_all_post_types() {
305
306 $post_types = get_post_types(
307 [
308 'show_ui' => true,
309 ],
310 'objects'
311 );
312
313 $post_type_names = [];
314 foreach ($post_types as $post_type) {
315 if (in_array($post_type->name, ['attachment', 'wp_navigation', 'wp_block'])) {
316 continue;
317 }
318 if($post_type->name === 'post' || $post_type->name === 'page' ){
319 $post_type_names[$post_type->name] = $post_type->label;
320 } else {
321 $is_pro = false;
322 if(class_exists('\\WPAdminify\\Pro\\Adminify_Pro')){
323 $is_pro = \WPAdminify\Pro\Adminify_Pro::is_premium();
324 }
325 $pro_notice = empty($is_pro) ? Utils::adminify_upgrade_pro_class() : '';
326 $post_type_names[$post_type->name] = $post_type->label . $pro_notice;
327 }
328 }
329 return $post_type_names;
330 }
331
332 public static function get_all_taxonomies() {
333 $taxonomies = get_taxonomies(
334 [
335 'show_ui' => true,
336 ],
337 'objects'
338 );
339 $taxonomy_names = [];
340 foreach ( $taxonomies as $taxonomy ) {
341 if ( $taxonomy->name == 'post_format' ) {
342 continue;
343 }
344
345 $is_pro = false;
346 if (class_exists('\\WPAdminify\\Pro\\Adminify_Pro')) {
347 $is_pro = \WPAdminify\Pro\Adminify_Pro::is_premium();
348 }
349 $pro_notice = empty($is_pro) ? Utils::adminify_upgrade_pro_class() : '';
350 $taxonomy_names[ $taxonomy->name ] = $taxonomy->label . $pro_notice;
351
352 }
353 return $taxonomy_names;
354 }
355
356
357 /**
358 * Modules
359 *
360 */
361 public function modules_settings(&$fields)
362 {
363 $fields[] = [
364 'id' => 'menu_duplicator',
365 'type' => 'switcher',
366 'title' => __('Menu Duplicator', 'adminify'),
367 'subtitle' => __('Enable Menu Duplicator to increase your productivity.', 'adminify'),
368 'text_on' => __('Yes', 'adminify'),
369 'text_off' => __('No', 'adminify'),
370 'text_width' => 80,
371 'default' => $this->get_default_field('menu_duplicator'),
372 ];
373
374 $fields[] = [
375 'id' => 'post_duplicator',
376 'title' => __('Post Duplicator', 'adminify'),
377 'subtitle' => __('Enable Post/Page/Custom Post Types Duplicator to increase your productivity.', 'adminify'),
378 'type' => 'fieldset',
379 'default' => $this->get_default_field('post_duplicator'),
380 'fields' => [
381 [
382 'id' => 'enable_post_duplicator',
383 'type' => 'switcher',
384 'title' => __('', 'adminify'),
385 'class' => 'adminify-pl-0',
386 'text_on' => __('Show', 'adminify'),
387 'text_off' => __('Hide', 'adminify'),
388 'text_width' => 80,
389 'default' => $this->get_default_field('post_duplicator')['enable_post_duplicator'],
390 ],
391 [
392 'id' => 'post_types',
393 'type' => 'checkbox',
394 'title' => __('Enable for Post Types', 'adminify'),
395 'subtitle' => __('Select Post Types for Enabling Duplicate feature', 'adminify'),
396 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
397 'default' => $this->get_default_field('post_duplicator')['post_types'],
398 'dependency' => ['enable_post_duplicator', '==', 'true', 'true'],
399 ],
400 [
401 'id' => 'taxonomies',
402 'type' => 'checkbox',
403 'title' => sprintf(__('Enable for Taxonomies %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
404 'subtitle' => __('Enable for Taxonomies', 'adminify'),
405 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_taxonomies',
406 'query_args' => [
407 'orderby' => 'post_title',
408 'order' => 'ASC',
409 ],
410 'default' => $this->get_default_field('post_duplicator')['taxonomies'],
411 'dependency' => ['enable_post_duplicator', '==', 'true', 'true'],
412 ]
413
414 ],
415 ];
416 }
417
418
419
420 /**
421 * Post/Page Columns
422 */
423
424 public function custom_admin_columns(&$admin_columns)
425 {
426 $admin_columns[] = [
427 'id' => 'custom_admin_columns',
428 'title' => __('Custom Admin Columns', 'adminify'),
429 'subtitle' => __('Add Custom Admin Columns for Post Types or Taxonomies', 'adminify'),
430 'type' => 'fieldset',
431 'fields' => [
432 [
433 'id' => 'enable',
434 'type' => 'switcher',
435 'class' => 'adminify-pl-0',
436 'title' => __('', 'adminify'),
437 'text_on' => __('Show', 'adminify'),
438 'text_off' => __('Hide', 'adminify'),
439 'text_width' => 80,
440 'default' => $this->get_default_field('custom_admin_columns')['enable'],
441 ],
442 [
443 'id' => 'columns_data',
444 'type' => 'checkbox',
445 'class' => 'adminify-one-col',
446 'title' => __('', 'adminify'),
447 'options' => [
448 'post_thumb_column' => sprintf(__('Show Post Thumbnails Column? %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
449 'post_page_id_column' => sprintf(__('Show Post/Page ID Column. Display "ID" column for post and page table lists. %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
450 'comment_id_column' => __('Show "Comment ID" Column for Comment, Also show "Parent ID"', 'adminify'),
451 'last_login_column' => sprintf(__('Show "Last Login" Column for Users %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
452 'taxonomy_id_column' => __('Show "Taxonomy ID" Column for all possible types of taxonomies', 'adminify'),
453 ],
454 'default' => $this->get_default_field('custom_admin_columns')['columns_data'],
455 'dependency' => ['enable', '==', 'true', true],
456 ],
457 [
458 'id' => 'post_page_column_thumb_image',
459 'type' => 'media',
460 'class' => 'custom-thumb-image',
461 'title' => __('Column Thumbnail Image', 'adminify'),
462 'library' => 'image',
463 'preview_size' => 'thumbnail',
464 'button_title' => __('Add Thumbnail Image', 'adminify'),
465 'remove_title' => __('Remove Thumbnail Image', 'adminify'),
466 'default' => $this->get_default_field('custom_admin_columns')['post_page_column_thumb_image'],
467 'dependency' => array('columns_data', 'any', 'post_thumb_column', 'true'),
468 ]
469 ]
470 ];
471 }
472
473
474
475
476 /**
477 * Gutenberg Settings
478 */
479
480 public function gutenberg_settings(&$fields)
481 {
482
483 $fields[] = [
484 'id' => 'remove_widgets',
485 'title' => __('Widgets Removal', 'adminify'),
486 'type' => 'fieldset',
487 'subtitle' => __('Remove unwanted Sidebar Widgets & Dashboard Widgets', 'adminify'),
488 'fields' => [
489 [
490 'id' => 'remove_widgets_type',
491 'type' => 'button_set',
492 'class' => 'adminify-pl-0 !adminify-flex',
493 'options' => [
494 'sidebar' => __('Sidebar Widgets', 'adminify'),
495 'dashboard' => __('Dashboard Widgets', 'adminify'),
496 ],
497 'default' => $this->get_default_field('remove_widgets')['remove_widgets_type'],
498 ],
499 [
500 'id' => 'disable_gutenberg_editor',
501 'type' => 'switcher',
502 'label' => sprintf(__('<h4>%s</h4>', 'adminify'), __('Disable Gutenberg Editor for Widgets', 'adminify')),
503 'class' => 'adminify-pl-0 adminify-col-fit',
504 'text_on' => __('Yes', 'adminify'),
505 'text_off' => __('No', 'adminify'),
506 'text_width' => 80,
507 'default' => $this->get_default_field('remove_widgets')['disable_gutenberg_editor'],
508 'dependency' => ['remove_widgets_type', '==', 'sidebar', true],
509 ],
510 [
511 'id' => 'sidebar_widgets_list',
512 'type' => 'checkbox',
513 'class' => 'adminify-one-col',
514 'title' => __('', 'adminify'),
515 'options' => '\WPAdminify\Inc\Classes\Sidebar_Widgets::render_sidebar_checkboxes',
516 'default' => $this->get_default_field('remove_widgets')['sidebar_widgets_list'],
517 'dependency' => ['remove_widgets_type|disable_gutenberg_editor', '==|==', 'sidebar|true', true],
518 ],
519 [
520 'id' => 'dashboard_widgets_list',
521 'type' => 'checkbox',
522 'class' => "adminify-one-col",
523 'title' => __('', 'adminify'),
524 'options' => '\WPAdminify\Inc\Classes\DashboardWidgets::render_dashboard_checkboxes',
525 'default' => $this->get_default_field('remove_widgets')['dashboard_widgets_list'],
526 'dependency' => ['remove_widgets_type', '==', 'dashboard', true],
527 ],
528 ]
529 ];
530 }
531
532
533 /**
534 * Security: Attachments
535 *
536 * @return void
537 */
538 public function productivity_attachment_fields(&$attachment_fields)
539 {
540
541 $allowed_upload_files_type = [
542 'svg' => sprintf(__('SVG Files %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
543 'avif' => sprintf(__('AVIF Files %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
544 'ico' => sprintf(__('ICO Files %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
545 'webp' => sprintf(__('WEBP Files %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
546 ];
547
548 $attachment_fields_data = [
549 [
550 'id' => 'enable_media',
551 'type' => 'switcher',
552 'title' => __('', 'adminify'),
553 'class' => 'adminify-pl-0',
554 'text_on' => __('Show', 'adminify'),
555 'text_off' => __('Hide', 'adminify'),
556 'text_width' => 80,
557 'default' => $this->get_default_field('media_attachments')['enable_media'],
558 ],
559 // [
560 // 'id' => 'media_ininite_scroll',
561 // 'type' => 'switcher',
562 // 'title' => sprintf(__('Infinite Scroll for Media Library? %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
563 // 'class' => 'adminify-pl-0 adminify-pt-0 adminify-pro-fieldset adminify-pro-notice',
564 // 'text_on' => __('Yes', 'adminify'),
565 // 'text_off' => __('No', 'adminify'),
566 // 'text_width' => 80,
567 // 'subtitle' => __('Re-enable infinite scrolling in the media library\'s grid view to ease navigation through a large collection.', 'adminify'),
568 // 'default' => $this->get_default_field('media_attachments')['media_ininite_scroll'],
569 // 'dependency' => ['enable_media', '==', 'true', true],
570 // ],
571 [
572 'id' => 'thumbnails_rss_feed',
573 'type' => 'switcher',
574 'title' => __('Post Thumbnails on RSS', 'adminify'),
575 'class' => 'adminify-pl-0',
576 'text_on' => __('Yes', 'adminify'),
577 'text_off' => __('No', 'adminify'),
578 'text_width' => 80,
579 'subtitle' => __('Show/Hide Post Thumbnails on RSS excerpt and Content Feed.', 'adminify'),
580 'default' => $this->get_default_field('media_attachments')['thumbnails_rss_feed'],
581 'dependency' => ['enable_media', '==', 'true', true],
582 ],
583 // [
584 // 'id' => 'allowed_upload_files',
585 // 'type' => 'checkbox',
586 // 'class' => 'adminify-pl-0',
587 // 'title' => sprintf(__('Allowed Files Uploads %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
588 // 'subtitle' => __('Allow SVG/JPEG/WEBP/ICO/AVIF Files Upload', 'adminify'),
589 // 'options' => $allowed_upload_files_type,
590 // 'default' => $this->get_default_field('media_attachments')['allowed_upload_files'],
591 // 'dependency' => ['enable_media', '==', 'true', true],
592 // ],
593 // [
594 // 'id' => 'convert_to_webp',
595 // 'type' => 'switcher',
596 // 'class' => 'adminify-pl-0',
597 // 'text_on' => __('Yes', 'adminify'),
598 // 'text_off' => __('No', 'adminify'),
599 // 'text_width' => 80,
600 // 'class' => 'adminify-pl-0',
601 // 'title' => sprintf(__('Convert to WEBP %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
602 // 'subtitle' => __('Convert Uploaded image to WEBP', 'adminify'),
603 // 'default' => $this->get_default_field('media_attachments')['convert_to_webp'],
604 // 'dependency' => ['enable_media', '==', 'true', true],
605 // ],
606 // [
607 // 'id' => 'featured_to_post',
608 // 'type' => 'switcher',
609 // 'class' => 'adminify-pl-0',
610 // 'text_on' => __('Yes', 'adminify'),
611 // 'text_off' => __('No', 'adminify'),
612 // 'text_width' => 80,
613 // 'class' => 'adminify-pl-0',
614 // 'title' => sprintf(__('Link Featured Images to Post %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
615 // 'subtitle' => __('Wrap featured images in your theme in links to posts.', 'adminify'),
616 // 'default' => $this->get_default_field('media_attachments')['featured_to_post'],
617 // 'dependency' => ['enable_media', '==', 'true', true],
618 // ],
619 // [
620 // 'id' => 'media_lowercase',
621 // 'type' => 'switcher',
622 // 'title' => sprintf(__('Lowercase Filenames for Uploads %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
623 // 'subtitle' => __('Make all the filenames of new uploads to lowercase', 'adminify'),
624 // 'class' => 'adminify-pl-0',
625 // 'text_on' => __('Yes', 'adminify'),
626 // 'text_off' => __('No', 'adminify'),
627 // 'text_width' => 80,
628 // 'class' => 'adminify-pl-0',
629 // 'default' => $this->get_default_field('media_attachments')['media_lowercase'],
630 // 'dependency' => ['enable_media', '==', 'true', true],
631 // ],
632 ];
633
634 $attachment_fields[] = array(
635 'id' => 'media_attachments',
636 'type' => 'fieldset',
637 'title' => __('Media Settings', 'adminify'),
638 'subtitle' => __('Media Attachement Settings', 'adminify'),
639 'fields' => $attachment_fields_data,
640 // 'default' => $this->get_default_field('media_attachments'),
641 );
642 }
643
644
645 /**
646 * Productivity Settings
647 *
648 * @return void
649 */
650 public function productivity_settings()
651 {
652 if (!class_exists('ADMINIFY')) {
653 return;
654 }
655
656 $fields = [];
657
658 $this->admin_notices_settings($fields);
659
660 $this->screen_options($fields);
661
662 // Folders
663 $this->folders_post_types_settings( $fields );
664
665 // Post Types Order
666 $this->post_types_order_options( $fields );
667
668 // Duplicator Settings
669 $this->modules_settings( $fields );
670
671 // Admin Columns
672 $this->custom_admin_columns($fields);
673
674 // Media Attachment files
675 $this->productivity_attachment_fields($fields);
676
677 $this->gutenberg_settings($fields);
678
679 $fields = apply_filters('adminify_settings/productivity', $fields, $this);
680
681 // Productivity Section
682 \ADMINIFY::createSection(
683 $this->prefix,
684 [
685 'title' => __('Productivity', 'adminify'),
686 'id' => 'productivity',
687 'icon' => 'fas fa-business-time',
688 'fields' => $fields,
689 ]
690 );
691 }
692 }
693 }
694