PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 2.0.3
Adminify – White Label, Admin Menu Editor, Login Customizer v2.0.3
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 / DashboardWidgets.php

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

75 lines 2.6 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\AdminSettingsModel;
7
8 if (!defined('ABSPATH')) {
9 die;
10 } // Cannot access directly.
11
12 class DashboardWidgets extends AdminSettingsModel
13 {
14 public function __construct()
15 {
16 $this->dasboard_widgets_settings();
17 }
18
19 public function get_defaults()
20 {
21 return [
22 'dashboard_widgets' => [
23 'dashboard_widgets_user_roles' => [],
24 'dashboard_widgets_list' => []
25 ]
26 ];
27 }
28
29 public function dasboard_widgets_settings()
30 {
31
32 if (!class_exists('ADMINIFY')) {
33 return;
34 }
35
36 // Dashboard Widgets Section
37 \ADMINIFY::createSection($this->prefix, array(
38 'title' => __('Dashboard Widgets', WP_ADMINIFY_TD),
39 'icon' => 'dashicons dashicons-dashboard',
40 'parent' => 'widget_settings',
41 'id' => 'dashboard_widgets',
42 'fields' => array(
43 array(
44 'type' => 'subheading',
45 'content' => Utils::adminfiy_help_urls(
46 __('Dashboard Widgets Settings', WP_ADMINIFY_TD),
47 'https://wpadminify.com/kb/wp-widget-settings/',
48 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
49 'https://www.facebook.com/groups/jeweltheme',
50 'https://wpadminify.com/support/'
51 )
52 ),
53 array(
54 'id' => 'dashboard_widgets_user_roles',
55 'type' => 'select',
56 'title' => __('Visible for', WP_ADMINIFY_TD),
57 'placeholder' => __('Select User roles you want to show', WP_ADMINIFY_TD),
58 'options' => 'roles',
59 'multiple' => true,
60 'chosen' => true,
61 'default' => $this->get_default_field('dashboard_widgets')['dashboard_widgets_user_roles'],
62 ),
63 array(
64 'id' => 'dashboard_widgets_list',
65 'type' => 'checkbox',
66 'title' => __('Remove unwanted Widgets', WP_ADMINIFY_TD),
67 'options' => '\WPAdminify\Inc\Classes\DashboardWidgets::render_dashboard_checkboxes',
68 'default' => $this->get_default_field('dashboard_widgets')['dashboard_widgets_list'],
69 )
70
71 )
72 ));
73 }
74 }
75