PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.2.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.2.2
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.2.2, at Inc/Admin/Options/Productivity.php

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