PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.4.5
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.4.5
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.4.5, at Inc/Admin/Admin.php

208 lines 5.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 // Freemius Hooks
44 jltwp_adminify()->add_filter('freemius_pricing_js_path', array($this, 'jltwp_new_freemius_pricing_js'));
45 jltwp_adminify()->add_filter('plugin_icon', array($this, 'jltwp_adminify_logo_icon'));
46
47 jltwp_adminify()->add_filter('support_forum_url', [$this, 'jltwp_adminify_support_forum_url']);
48
49 // Disable deactivation feedback form
50 jltwp_adminify()->add_filter('show_deactivation_feedback_form', '__return_false');
51
52 // Disable after deactivation subscription cancellation window
53 jltwp_adminify()->add_filter('show_deactivation_subscription_cancellation', '__return_false');
54 }
55
56
57 /**
58 * Adminify Logo
59 *
60 * @param [type] $logo
61 *
62 * @return void
63 */
64 public function jltwp_adminify_logo_icon($logo)
65 {
66 $logo = WP_ADMINIFY_PATH . '/assets/images/adminify.svg';
67 return $logo;
68 }
69
70 public function jltwp_new_freemius_pricing_js($default_pricing_js_path)
71 {
72 return WP_ADMINIFY_PATH . '/Libs/freemius-pricing/freemius-pricing.js';
73 }
74
75
76 // Gutenberg Editor WordPress Logo Change
77 public function change_gutenberg_editor_logo()
78 {
79
80 // it is not a necessary thing but it prevents this CSS to be added on every WordPress admin page
81 $screen = get_current_screen();
82 if (!$screen->is_block_editor) {
83 return;
84 }
85
86 $gutenberg_editor_logo = (array) AdminSettings::get_instance()->get('gutenberg_editor_logo');
87 if( !empty( $gutenberg_editor_logo['url'] )){
88 $gutenberg_editor_logo_url = $gutenberg_editor_logo['url'];
89
90 /* hides the logo */
91 // body.js.is-fullscreen-mode .edit-post-header a.components-button svg{
92 // display: none;
93 // }
94 /* adds a custom image */
95
96 echo '<style>
97 body.js.is-fullscreen-mode .edit-post-header a.components-button:before{
98 background-image: url( ' . esc_url($gutenberg_editor_logo_url) . ' );
99 background-size: cover;
100 /* you can the image paddings with the parameters below*/
101 top: 10px;
102 right: 10px;
103 bottom: 10px;
104 left: 10px;
105 }
106
107 body.js.is-fullscreen-mode .edit-post-header a.components-button svg {
108 display: block !important;
109 }
110
111 .components-tab-panel__tabs-item:before {
112 top: 32px;
113 }
114 .wp-adminify.is-fullscreen-mode #wpadminbar{
115 display: none !important;
116 }
117
118 </style>';
119 }
120 }
121
122
123 /**
124 * WP Adminify: Modules
125 */
126 public function jltwp_adminify_modules_manager()
127 {
128 $this->options = (array) AdminSettings::get_instance()->get();
129 new Modules();
130 new CustomAdminColumns();
131 new MenuStyle($this->options);
132 new AdminBar();
133 new Tweaks();
134 new Sidebar_Widgets();
135 new OutputCSS();
136 new ThirdPartyCompatibility();
137 new AdminFooterText();
138
139 // Register Default Dashboard Widgets
140 new DashboardWidgets();
141
142 // Version Rollback
143 Adminify_Rollback::get_instance();
144 }
145
146
147 /**
148 * Remove Page Headlines: Dashboard, Plugins, Users
149 *
150 * @return void
151 */
152 public function remove_page_headline()
153 {
154 $screen = get_current_screen();
155 if (empty($screen->id)) {
156 return;
157 }
158
159 if (in_array(
160 $screen->id,
161 [
162 'dashboard',
163 'nav-menus',
164 'edit-tags',
165 'themes',
166 'widgets',
167 'plugins',
168 'plugin-install',
169 'users',
170 'user',
171 'profile',
172 'tools',
173 'import',
174 'export',
175 'export-personal-data',
176 'erase-personal-data',
177 'options-general',
178 'options-writing',
179 'options-reading',
180 'options-discussion',
181 'options-media',
182 'options-permalink',
183 ]
184 )) {
185 echo '<style>#wpbody-content .wrap > h1,#wpbody-content .wrap > h1.wp-heading-inline{display:none;}</style>';
186 }
187 }
188
189
190 /**
191 * Support Contact URL
192 *
193 * @param [type] $support_url and Pro Support
194 *
195 * @return void
196 */
197 public function jltwp_adminify_support_forum_url($support_url)
198 {
199 if (jltwp_adminify()->is_premium()) {
200 $support_url = 'https://wpadminify.com/contact';
201 } else {
202 $support_url = 'https://wordpress.org/support/plugin/adminify/';
203 }
204 return $support_url;
205 }
206 }
207 }
208