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

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

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