PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.1
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.1
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 / Admin.php

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

170 lines 4.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;
4
5 use WPAdminify\Inc\Utils;
6 use \WPAdminify\Inc\Classes\Tweaks;
7 use \WPAdminify\Inc\Classes\MenuStyle;
8 use \WPAdminify\Inc\Classes\CustomAdminColumns;
9 use \WPAdminify\Inc\Classes\AdminBar;
10 use \WPAdminify\Inc\Classes\DashboardWidgets;
11 use \WPAdminify\Inc\Classes\Sidebar_Widgets;
12 use \WPAdminify\Inc\Classes\OutputCSS;
13 use \WPAdminify\Inc\Classes\ThirdPartyCompatibility;
14 use \WPAdminify\Inc\Classes\AdminFooterText;
15 use \WPAdminify\Inc\Admin\Modules;
16 use WPAdminify\Inc\Classes\Adminify_Rollback;
17 use WPAdminify\Inc\Admin\AdminSettings;
18
19 // no direct access allowed
20 if (!defined('ABSPATH')) {
21 exit;
22 }
23 /**
24 * WP Adminify
25 * Admin Class
26 *
27 * @author Jewel Theme <support@jeweltheme.com>
28 */
29
30 if (!class_exists('Admin')) {
31 class Admin
32 {
33
34 public function __construct()
35 {
36 $this->jltwp_adminify_modules_manager();
37
38 // Remove Page Header like - Dashboard, Plugins, Users etc
39 add_action('admin_head', [$this, 'remove_page_headline'], 99);
40 add_action('admin_head', [$this, 'change_gutenberg_editor_logo'], 99);
41
42 jltwp_adminify()->add_filter('support_forum_url', [$this, 'jltwp_adminify_support_forum_url']);
43
44 // Disable deactivation feedback form
45 jltwp_adminify()->add_filter('show_deactivation_feedback_form', '__return_false');
46
47 // Disable after deactivation subscription cancellation window
48 jltwp_adminify()->add_filter('show_deactivation_subscription_cancellation', '__return_false');
49 }
50
51
52 // Gutenberg Editor WordPress Logo Change
53 public function change_gutenberg_editor_logo()
54 {
55
56 // it is not a necessary thing but it prevents this CSS to be added on every WordPress admin page
57 $screen = get_current_screen();
58 if (!$screen->is_block_editor) {
59 return;
60 }
61
62 $gutenberg_editor_logo = (array) AdminSettings::get_instance()->get('gutenberg_editor_logo');
63
64 echo '<style>
65 /* hides the logo */
66 body.is-fullscreen-mode .edit-post-header a.components-button svg{
67 display: none;
68 }
69 /* adds a custom image */
70 body.is-fullscreen-mode .edit-post-header a.components-button:before{
71 background-image: url( ' . esc_url($gutenberg_editor_logo['url']) . ' );
72 background-size: cover;
73 /* you can the image paddings with the parameters below*/
74 top: 10px;
75 right: 10px;
76 bottom: 10px;
77 left: 10px;
78 }
79 </style>';
80 }
81
82
83 /**
84 * WP Adminify: Modules
85 */
86 public function jltwp_adminify_modules_manager()
87 {
88 $this->options = (array) AdminSettings::get_instance()->get();
89 new Modules();
90 new CustomAdminColumns();
91 new MenuStyle($this->options);
92 if (!empty($this->options['admin_ui'])) {
93 new AdminBar();
94 }
95 new Tweaks();
96 new Sidebar_Widgets();
97 new OutputCSS();
98 new ThirdPartyCompatibility();
99 new AdminFooterText();
100
101 // Register Default Dashboard Widgets
102 new DashboardWidgets();
103
104 // Version Rollback
105 Adminify_Rollback::get_instance();
106 }
107
108
109 /**
110 * Remove Page Headlines: Dashboard, Plugins, Users
111 *
112 * @return void
113 */
114 public function remove_page_headline()
115 {
116 $screen = get_current_screen();
117 if (empty($screen->id)) {
118 return;
119 }
120
121 if (in_array(
122 $screen->id,
123 [
124 'dashboard',
125 'nav-menus',
126 'edit-tags',
127 'themes',
128 'widgets',
129 'plugins',
130 'plugin-install',
131 'users',
132 'user',
133 'profile',
134 'tools',
135 'import',
136 'export',
137 'export-personal-data',
138 'erase-personal-data',
139 'options-general',
140 'options-writing',
141 'options-reading',
142 'options-discussion',
143 'options-media',
144 'options-permalink',
145 ]
146 )) {
147 echo '<style>#wpbody-content .wrap > h1,#wpbody-content .wrap > h1.wp-heading-inline{display:none;}</style>';
148 }
149 }
150
151
152 /**
153 * Support Forum URL
154 *
155 * @param [type] $support_url and Pro Support
156 *
157 * @return void
158 */
159 public function jltwp_adminify_support_forum_url($support_url)
160 {
161 if (jltwp_adminify()->is_premium()) {
162 $support_url = 'https://wpadminify.com/support';
163 } else {
164 $support_url = 'https://wordpress.org/support/plugin/adminify/';
165 }
166 return $support_url;
167 }
168 }
169 }
170