PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.4.1
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.4.1
4.3.3 4.3.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 All 166 releases
← All changes | Inc/Classes/ThirdPartyCompatibility.php +104 -686 4.3.1 → 3.2.4.1 View file →
@@ -1,595 +1,100 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Classes;
3 +namespace WPAdminify\Inc\Classes;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use PXLBSAdminify\Inc\Admin\AdminSettings;
7 -use PXLBSAdminify\Inc\Modules\MenuEditor\MenuEditorOptions;
5 +use WPAdminify\Inc\Utils ;
6 +use WPAdminify\Inc\Admin\AdminSettings ;
7 +use WPAdminify\Inc\Modules\MenuEditor\MenuEditorOptions ;
8 8 // no direct access allowed
9 9 if ( !defined( 'ABSPATH' ) ) {
10 10 exit;
11 11 }
12 12 /**
13 - * PXLBSAdminify
13 + * WPAdminify
14 14 * Third Party Plugins Compatibility
15 15 *
16 16 * @author Jewel Theme <[email protected]>
17 17 */
18 -class ThirdPartyCompatibility {
19 - public $menu_settings;
20 -
21 - public function __construct() {
18 +class ThirdPartyCompatibility
19 +{
20 + public $menu_settings ;
21 + public function __construct()
22 + {
22 23 $this->menu_settings = ( new MenuEditorOptions() )->get();
23 - add_action( 'init', [$this, 'register_actions_on_init'], 0 );
24 - add_action( 'admin_init', [$this, 'register_actions_on_admin_init'], 0 );
24 + add_action( 'init', [ $this, 'register_actions_on_init' ], 0 );
25 + add_action( 'admin_init', [ $this, 'register_actions_on_admin_init' ], 0 );
25 26 // 24-3-24
26 - add_action( 'admin_enqueue_scripts', [$this, 'reset_theme_conflicts'], 999999 );
27 - // 28-6-24
28 - add_action( 'admin_head', [$this, 'plugin_conflicts'], 999999 );
29 - // Inject layout-tightening CSS INTO the block editor iframe (parent CSS
30 - // cannot reach inside). Closes the huge top gap between the editor toolbar
31 - // and the post title that's amplified inside the Adminify iframe wrapper.
32 - // add_filter('block_editor_settings_all', [$this, 'block_editor_iframe_layout_tweaks']); // TODO: comment because not product this issue. if we product this issue then think about why create this this and solve it all type of users
33 - if ( Utils::is_plugin_active( 'gravityforms/gravityforms.php' ) ) {
34 - add_filter(
35 - 'update_footer',
36 - [$this, 'change_admin_footer'],
37 - 9999,
38 - 3
39 - );
40 - }
41 - // YITH Plugin Framework panels rendered on WP list pages.
42 - add_action( 'in_admin_header', [$this, 'reorder_notice_wrapper_for_yith_panel'], 0 );
43 - // All Fluent Plugin Assets Supports
44 - $this->whitelist_assets_in_fluent_plugins();
27 + add_action( 'admin_enqueue_scripts', [ $this, 'jltwp_adminify_reset_theme_conflicts' ], 999999 );
45 28 }
46 -
47 - /**
48 - * Whitelist Adminify assets in Fluent ecosystem no-conflict mode.
49 - *
50 - * Fluent Boards, Fluent Booking, Fluent CRM, Fluent Community, Fluent Forms,
51 - * and Fluent Snippets (easy-code-manager) iterate $wp_scripts->queue on their
52 - * admin pages and dequeue every plugin script whose src isn't in their approved
53 - * slug list. Without this whitelist, Adminify's frame-adminify--admin script is
54 - * stripped, leaving an empty React mount (white screen).
55 - */
56 - public function whitelist_assets_in_fluent_plugins() {
57 - $add_regex = function ( $slugs ) {
58 - $slugs[] = '\\/adminify\\/';
59 - return $slugs;
60 - };
61 - if ( Utils::is_plugin_active( 'fluent-boards/fluent-boards.php' ) ) {
62 - add_filter( 'fluent_boards/asset_listed_slugs', $add_regex );
63 - }
64 - if ( Utils::is_plugin_active( 'fluent-booking/fluent-booking.php' ) ) {
65 - add_filter( 'fluent_booking/asset_listed_slugs', $add_regex );
66 - }
67 - if ( Utils::is_plugin_active( 'fluent-crm/fluent-crm.php' ) ) {
68 - add_filter( 'fluent_crm_asset_listed_slugs', $add_regex );
69 - }
70 - if ( Utils::is_plugin_active( 'fluent-community/fluent-community.php' ) ) {
71 - add_filter( 'fluent_community/asset_listed_slugs', $add_regex );
72 - add_filter( 'fluent_com_editor/asset_listed_slugs', $add_regex );
73 - }
74 - if ( Utils::is_plugin_active( 'easy-code-manager/easy-code-manager.php' ) ) {
75 - add_filter( 'fluent_snippets_asset_listed_slugs', $add_regex );
76 - }
77 - if ( Utils::is_plugin_active( 'fluentform/fluentform.php' ) ) {
78 - add_filter( 'fluentform/exclude_js_slugs_from_dequeue', function ( $slugs ) {
79 - $slugs[] = 'adminify';
80 - return $slugs;
81 - } );
82 - }
83 - }
84 -
85 - /**
86 - * Gravity Form Custom Footer missing div closing support
87 - */
88 - public function change_admin_footer( $footer_text ) {
89 - $current_screen = get_current_screen();
90 - if ( !empty( $current_screen ) && ($current_screen->id === 'toplevel_page_gf_edit_forms' || $current_screen->id === 'forms_page_gf_new_form') ) {
91 - return $footer_text . '</div>';
92 - }
93 - return $footer_text;
94 - }
95 -
96 - /**
97 - * YITH Plugin Framework panel pages (YITH WooCommerce Multi Vendor, Booking,
98 - * Membership, ... — anything using plugin-fw) render blank while the
99 - * "Hide Admin Notices" option is on.
100 - *
101 - * YIT_Plugin_Panel::print_panel_tabs_in_wp_pages() hooks all_admin_notices at
102 - * priority 10 and opens page wrapper <div>s on purpose — they stay open until
103 - * admin_footer. Adminify closes its own .adminify-notices-wrapper on
104 - * all_admin_notices at priority 99999999, so that </div> lands inside YITH's
105 - * markup and closes YITH's .wrap instead. The notice wrapper then never closes
106 - * and swallows the rest of the page, which Adminify hides through
107 - * `.adminify-notices-wrapper > *:not(...) { display: none !important; }`.
108 - *
109 - * Fix: close the notice wrapper before YITH opens its own markup, so both
110 - * outputs stay balanced. Notices printed after that point are not wrapped,
111 - * which costs nothing here — plugin-fw moves every notice into its own
112 - * #yith-plugin-fw__panel__notices box with JS on these screens anyway.
113 - *
114 - * @return void
115 - */
116 - public function reorder_notice_wrapper_for_yith_panel() {
117 - global $wp_filter;
118 - if ( empty( $wp_filter['all_admin_notices'] ) || empty( $wp_filter['all_admin_notices']->callbacks ) ) {
119 - return;
120 - }
121 - $hooked_callbacks = $wp_filter['all_admin_notices']->callbacks;
122 - // Priority YITH opens its unclosed page wrapper at, if it does at all.
123 - $yith_priority = null;
124 - foreach ( $hooked_callbacks as $priority => $callbacks ) {
125 - foreach ( $callbacks as $callback ) {
126 - if ( is_array( $callback['function'] ) && isset( $callback['function'][1] ) && 'print_panel_tabs_in_wp_pages' === $callback['function'][1] ) {
127 - $yith_priority = (int) $priority;
128 - break 2;
129 - }
130 - }
131 - }
132 - // No YITH panel on this screen, or no room left to close before it.
133 - if ( null === $yith_priority || $yith_priority < 1 ) {
134 - return;
135 - }
136 - // Move Adminify's notice wrapper closer ahead of YITH's opening markup.
137 - foreach ( $hooked_callbacks as $priority => $callbacks ) {
138 - if ( (int) $priority <= $yith_priority ) {
139 - continue;
140 - }
141 - foreach ( $callbacks as $callback ) {
142 - if ( is_array( $callback['function'] ) && isset( $callback['function'][1] ) && 'finish_notice_capture' === $callback['function'][1] ) {
143 - remove_action( 'all_admin_notices', $callback['function'], $priority );
144 - add_action( 'all_admin_notices', $callback['function'], $yith_priority - 1 );
145 - }
146 - }
147 - }
148 - }
149 -
150 - public function plugin_conflicts() {
151 - $adminify_ui = AdminSettings::get_instance()->get( 'admin_ui' );
152 - if ( !empty( $adminify_ui ) ) {
153 - // Motopress Hotel Booking Lite
154 - if ( Utils::is_plugin_active( 'motopress-hotel-booking-lite/motopress-hotel-booking.php' ) ) {
155 - echo '<style>
156 - .wp-adminify.bookings_page_mphb_calendar .widefat thead th,
157 - .wp-adminify.bookings_page_mphb_calendar .widefat tfoot th,
158 - .wp-adminify.bookings_page_mphb_calendar .widefat tbody td {
159 - padding: 0 !important;
160 - }
161 - .adminify-ui .widefat tbody tr td:first-child {
162 - border-left-color: inherit !important;
163 - }
164 - </style>';
165 - }
166 - // Fluent Support
167 - if ( Utils::is_plugin_active( 'fluent-support/fluent-support.php' ) ) {
168 - echo '<style>
169 - body.adminify-ui .fs_main_navbar{width:100%;top:0;left:0;}
170 - </style>';
171 - }
172 - // Fluent Affiliate
173 - if ( Utils::is_plugin_active( 'fluent-affiliate/fluent-affiliate.php' ) ) {
174 - echo '<style>
175 - body.adminify-ui #fluent-affiliate-app #fa_aff_menu {top:0;}
176 - </style>';
177 - }
178 - // Fluent Cart
179 - if ( Utils::is_plugin_active( 'fluent-cart/fluent-cart.php' ) ) {
180 - echo '<style>
181 - body.adminify-ui #wpbody-content #fct_admin_menu_holder .fct_admin_menu_wrap {width:100%;top:0;left:0;}
182 - </style>';
183 - }
184 - // Fluent CRM
185 - if ( Utils::is_plugin_active( 'fluent-crm/fluent-crm.php' ) ) {
186 - echo '<style>
187 - .wp-adminify.adminify-ui .fcrm_topbar {top:0;}
188 - </style>';
189 - }
190 - // WP 7.0+ Command Palette: kill the focus border on the cmdk input
191 - // (Adminify UI input styles bleed in) and wire the Adminify topbar
192 - // item (#adminify-top-menu-command-palette) to open the palette.
193 - echo '<style>
194 - .wp-adminify .commands-command-menu__container input[cmdk-input],
195 - .wp-adminify .commands-command-menu__container input[cmdk-input]:focus,
196 - .wp-adminify .commands-command-menu__container input[cmdk-input]:focus-visible {
197 - border: 0 !important;
198 - outline: 0 !important;
199 - box-shadow: none !important;
200 - }
201 - </style>';
202 - $pxlbsadminify_cmdk_js = "(function(){function openCmd(){try{if(window.wp&&wp.data&&wp.data.dispatch('core/commands')){wp.data.dispatch('core/commands').open();return;}}catch(e){}var isMac=/Mac|iPod|iPhone|iPad/.test(navigator.platform);document.dispatchEvent(new KeyboardEvent('keydown',{key:'k',code:'KeyK',keyCode:75,which:75,ctrlKey:!isMac,metaKey:isMac,bubbles:true,cancelable:true}));}document.addEventListener('click',function(e){var t=e.target&&e.target.closest&&e.target.closest('#adminify-top-menu-command-palette a, .adminify-top-menu-command-palette a');if(!t)return;e.preventDefault();openCmd();});}());";
203 - if ( function_exists( 'wp_print_inline_script_tag' ) ) {
204 - wp_print_inline_script_tag( $pxlbsadminify_cmdk_js );
205 - } else {
206 - echo '<script>' . $pxlbsadminify_cmdk_js . '</script>';
207 - // phpcs:ignore WordPress.WP.EnqueuedResources
208 - }
209 - // WP 7.0 block editor interface skeleton: pin to 0/0 inside Adminify UI.
210 - // WP's default left/top offsets are for the WP admin bar + sidebar which
211 - // Adminify hides — without this, the editor shifts off-origin.
212 - echo '<style>
213 - body.wp-adminify.adminify-ui .editor-editor-interface.edit-post-layout.interface-interface-skeleton,
214 - body.wp-adminify.adminify-ui .interface-interface-skeleton {
215 - left: 0 !important;
216 - top: 0 !important;
217 - }
218 - </style>';
219 - // WPML (sitepress-multilingual-cms) admin language switcher
220 - // (#WPML_ALS) is mirrored into the Adminify topbar. Its language
221 - // links otherwise switch inside the iframe, so the parent admin
222 - // chrome keeps the old language. Force a full top-window reload to
223 - // the chosen language URL so the whole admin re-renders.
224 - if ( Utils::is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
225 - $pxlbsadminify_wpml_js = "(function(){document.addEventListener('click',function(e){var li=e.target&&e.target.closest&&e.target.closest('[id^=\"adminify-top-menu-WPML_ALS_\"]');if(!li)return;var a=li.querySelector('a')||(e.target.closest('a'));if(!a)return;var href=a.getAttribute('href')||a.href;if(!href||href==='#')return;e.preventDefault();e.stopPropagation();window.top.location.href=href;},true);}());";
226 - if ( function_exists( 'wp_print_inline_script_tag' ) ) {
227 - wp_print_inline_script_tag( $pxlbsadminify_wpml_js );
228 - } else {
229 - echo '<script>' . $pxlbsadminify_wpml_js . '</script>';
230 - // phpcs:ignore WordPress.WP.EnqueuedResources
231 - }
232 - }
233 - }
234 - if ( Utils::is_plugin_active( 'squirrly-seo/squirrly.php' ) ) {
235 - // kept as-is for squirrly compat; the generic adminify-ui rule below covers all editor pages
236 - }
237 - if ( Utils::is_plugin_active( 'surecart/surecart.php' ) || Utils::is_plugin_active( 'suremember/suremember.php' ) ) {
238 - if ( !empty( $adminify_ui ) ) {
239 - echo '<style>
240 - .css-wa3qun,.backdrop-blur-sm {
241 - top: 0 !important;
242 - }
243 - #suremembers-settings-content::before, #sc-settings-content::before{
244 - width: 250px !important;
245 - }
246 - </style>';
247 - }
248 - }
249 - if ( Utils::is_plugin_active( 'advanced-database-cleaner-pro/advanced-db-cleaner.php' ) ) {
250 - echo '<style>
251 - .wp-adminify.toplevel_page_advanced_db_cleaner #wpbody-content .wp-list-table.widefat td{
252 - padding: 10px 10px;
253 - }
254 - .wp-adminify.toplevel_page_advanced_db_cleaner #wpbody-content input#aDBc_keep_button_revision {
255 - padding: 0px 3px !important;
256 - line-height: inherit !important;
257 - }
258 - </style>';
259 - }
260 - if ( Utils::is_plugin_active( 'insert-headers-and-footers/ihaf.php' ) ) {
261 - echo '<style>
262 - .wp-adminify .wpcode-code-type-picker, .wp-adminify .wpcode-code-type-picker-backdrop {
263 - left: 0;
264 - }
265 - </style>';
266 - }
267 - if ( Utils::is_plugin_active( 'advanced-access-manager/aam.php' ) ) {
268 - add_filter(
269 - 'pxlbsadminify_menu_option_compatibility_filter',
270 - array($this, 'apply_menu_restrictions_via_filter'),
271 - 10,
272 - 2
273 - );
274 - }
275 - if ( Utils::is_plugin_active( 'meta-box/meta-box.php' ) ) {
276 - echo '<style>
277 - .adminify-ui .og.mb {
278 - left: 0;
279 - }
280 - </style>';
281 - }
282 - if ( Utils::is_plugin_active( 'wp-security-audit-log/wp-security-audit-log.php' ) ) {
283 - echo '<script>
284 - jQuery(document).ready(function($) {
285 - $("body.wp-adminify.adminify-ui ul.frame-adminify-admin-menu li a .frame-adminify-menu-item-name").find("style").remove();
286 -
287 - setInterval(function() {
288 - $("body.wp-adminify.adminify-ui ul.frame-adminify-admin-menu li a .frame-adminify-menu-item-name").find("style").remove();
289 - }, 1000);
290 - });
291 - </script>';
292 - }
293 - if ( Utils::is_plugin_active( 'shopengine/shopengine.php' ) ) {
294 - global $pagenow;
295 - // e.g. "edit.php"
296 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check, no state change.
297 - $post_type = ( isset( $_GET['post_type'] ) ? sanitize_key( wp_unslash( $_GET['post_type'] ) ) : '' );
298 - // Build the slug
299 - $slug = ( $post_type ? "{$pagenow}?post_type={$post_type}" : $pagenow );
300 - // Example usage:
301 - if ( $slug === 'edit.php?post_type=shopengine-template' ) {
302 - echo '<style>
303 - #wpfooter {
304 - position: inherit !important;
305 - display: flex;
306 - flex-direction: column-reverse;
307 - }
308 - </style>';
309 - }
310 - }
311 - if ( Utils::is_plugin_active( 'breeze/breeze.php' ) ) {
312 - echo '<script>
313 - jQuery(document).ready(function($) {
314 -
315 - const iframe = document.getElementById("frame-adminify-app--iframe");
316 -
317 - const fileBtn = document.getElementById("adminify-top-menu-breeze-purge-file-group");
318 - const objectCacheBtn = document.getElementById("adminify-top-menu-breeze-purge-object-cache-group");
319 -
320 - if( fileBtn ) {
321 - fileBtn.addEventListener("click", function (e) {
322 - handleClickBreezeBtn("#wp-admin-bar-breeze-purge-file-group");
323 - });
324 - }
325 -
326 - if( objectCacheBtn ) {
327 - objectCacheBtn.addEventListener("click", function (e) {
328 - handleClickBreezeBtn("#wp-admin-bar-breeze-purge-object-cache-group");
329 - });
330 - }
331 -
332 - function handleClickBreezeBtn(selector) {
333 - try {
334 - const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
335 -
336 - // Find and click the button
337 - const button = iframeDoc.querySelector(selector);
338 - if (button) {
339 - button.click();
340 - }
341 - } catch (error) {
342 - console.error("Cannot access iframe content:", error);
343 - }
344 - }
345 - });
346 - </script>';
347 - }
348 - // Redis Object Cache plugin compatibility
349 - if ( Utils::is_plugin_active( 'redis-cache/redis-cache.php' ) ) {
350 - $nonce = wp_create_nonce();
351 - $ajaxurl = esc_url( admin_url( 'admin-ajax.php' ) );
352 - $flushingText = __( 'Flushing cache...', 'adminify' );
353 - echo '<script>
354 - jQuery(document).ready(function($) {
355 - const flushBtn = document.getElementById("adminify-top-menu-redis-cache-flush");
356 - const parentMenu = document.getElementById("adminify-top-menu-redis-cache");
357 -
358 - if (flushBtn) {
359 - const flushLink = flushBtn.querySelector("a");
360 -
361 - flushBtn.addEventListener("click", async function(e) {
362 - e.preventDefault();
363 - e.stopPropagation();
364 -
365 - if (!flushLink) return;
366 -
367 - // Store original text
368 - const originalText = flushLink.textContent || flushLink.innerText;
369 -
370 - // Close dropdown and show flushing text on parent menu
371 - const parentLink = parentMenu ? parentMenu.querySelector("a") : null;
372 - const parentOriginalHTML = parentLink ? parentLink.innerHTML : null;
373 -
374 - if (parentLink) {
375 - parentLink.innerHTML = "' . esc_js( $flushingText ) . '";
376 - }
377 -
378 - // Close dropdown
379 - const dropdown = flushBtn.closest(".adminify-dropdown");
380 - if (dropdown) {
381 - dropdown.classList.remove("show");
382 - }
383 -
384 - try {
385 - const data = new FormData();
386 - data.append("action", "roc_flush_cache");
387 - data.append("nonce", "' . esc_js( $nonce ) . '");
388 -
389 - const response = await fetch("' . esc_url( $ajaxurl ) . '", {
390 - method: "POST",
391 - body: data,
392 - });
393 -
394 - const resultText = await response.text();
395 -
396 - // Show result text
397 - if (parentLink) {
398 - parentLink.innerHTML = resultText;
399 - }
400 -
401 - // Reset to original after 3 seconds
402 - setTimeout(function() {
403 - if (parentLink && parentOriginalHTML) {
404 - parentLink.innerHTML = parentOriginalHTML;
405 - }
406 - }, 3000);
407 -
408 - } catch (error) {
409 - console.error("Object cache could not be flushed:", error);
410 - // Reset on error
411 - if (parentLink && parentOriginalHTML) {
412 - parentLink.innerHTML = parentOriginalHTML;
413 - }
414 - }
415 - });
416 - }
417 - });
418 - </script>';
419 - }
420 - }
421 -
422 - public function apply_menu_restrictions_via_filter( $menu_options, $menu ) {
423 - $aam_options = get_option( 'aam_access_settings', [] );
424 - if ( is_array( $aam_options ) ) {
425 - $simplified_aam_option = $this->simplify_aam_menu_restriction( $aam_options );
426 - $menu_options = $this->update_aam_menu_option( $menu_options, $simplified_aam_option );
427 - }
428 - return $menu_options;
429 - }
430 -
431 - public function simplify_aam_menu_restriction( $aam_option ) {
432 - $simplified_aam_option = [];
433 - foreach ( $aam_option['role'] as $role => $aam_role ) {
434 - if ( !empty( $aam_role['menu'] ) ) {
435 - foreach ( $aam_role['menu'] as $menu_item => $value ) {
436 - if ( !$value ) {
437 - continue;
438 - }
439 - $menu_item = str_replace( 'menu-', '', $menu_item );
440 - if ( !isset( $simplified_aam_option[$menu_item] ) ) {
441 - $simplified_aam_option[$menu_item] = [];
442 - }
443 - $simplified_aam_option[$menu_item][] = $role;
444 - }
445 - }
446 - }
447 - return $simplified_aam_option;
448 - }
449 -
450 - public function update_aam_menu_option( $menu_options, $simplified_aam_option ) {
451 - foreach ( $menu_options as $key => $item ) {
452 - // If this menu item is in restricted list, update hidden_for
453 - if ( isset( $simplified_aam_option[$key] ) ) {
454 - if ( !isset( $item['hidden_for'] ) ) {
455 - $item['hidden_for'] = [];
456 - }
457 - $item['hidden_for'] = array_merge( $item['hidden_for'], $simplified_aam_option[$key] );
458 - $item['hidden_for'] = array_unique( $item['hidden_for'] );
459 - }
460 - // If submenu exists, apply the function recursively
461 - // if (isset($item['submenu']) && is_array($item['submenu'])) {
462 - // $item['submenu'] = update_aam_menu_option($item['submenu'], $simplified_aam_option);
463 - // }
464 - $menu_options[$key] = $item;
465 - }
466 - return $menu_options;
467 - }
468 -
469 - public function reset_theme_conflicts() {
470 - global $pagenow;
29 +
30 + public function jltwp_adminify_reset_theme_conflicts()
31 + {
32 + global $pagenow ;
471 33 if ( $pagenow == 'wp-login.php' || $pagenow == 'wp-register.php' || $pagenow == 'customize.php' ) {
472 34 return;
473 35 }
474 - $screen = get_current_screen();
475 36 $theme = wp_get_theme();
476 37 // Neve WordPress Theme
477 38 if ( 'Neve' == $theme->name || 'Neve' == $theme->parent_theme ) {
478 39 wp_enqueue_style(
479 40 'wp-adminify_neve-theme',
480 - PXLBSADMINIFY_ASSETS . 'css/themes/neve.min.css',
41 + WP_ADMINIFY_ASSETS . 'css/themes/neve.min.css',
481 42 false,
482 - PXLBSADMINIFY_VER
43 + WP_ADMINIFY_VER
483 44 );
484 45 }
485 46 // Phlox WordPress Theme
486 47 if ( 'Phlox' == $theme->name || 'Phlox' == $theme->parent_theme ) {
487 - echo '<style>
48 + echo '<style>
488 49 .wp-adminify.adminify-ui #wpcontent .wp-adminify.adminify-top_bar {
489 50 opacity: 1 !important;
490 51 }
491 - </style>';
52 + </style>' ;
492 53 }
493 54 // Enfold WordPress Theme
494 55 if ( 'Enfold' == $theme->name || 'Enfold' == $theme->parent_theme ) {
495 - echo '<style>
56 + echo '<style>
496 57 .wp-adminify.avia-advanced-editor-enabled #wpadminbar{
497 58 display: none !important;
498 59 }
499 - </style>';
60 + </style>' ;
500 61 }
501 - // BrightHub theme compatibility fix
502 - if ( 'BrightHub' == $theme->name || 'BrightHub' == $theme->parent_theme ) {
503 - echo '<style>
504 - body.wp-adminify.adminify-ui.wp-theme-brighthub #wpadminbar,
505 - body.wp-adminify.adminify-ui.wp-theme-brighthub #adminmenumain{
506 - display: none !important;
507 - }
508 - .adminify-toolbar-wrapper .adminify-toolbar ul.adminify-top-menu li.adminify-top-menu-item{
509 - display: flex;
510 - width: auto;
511 - justify-content: center;
512 - align-items: center;
513 - }
514 - </style>';
515 - echo '<script>
516 - document.addEventListener("DOMContentLoaded", function() {
517 - document.documentElement.setAttribute("frame-adminify-app", "true");
518 -
519 - var iframe = document.querySelector(".adminify-frame-wrapper iframe");
520 - if (iframe) {
521 - iframe.addEventListener("load", function() {
522 - try {
523 - iframe.contentDocument.documentElement.setAttribute("frame-adminify-iframe", "true");
524 - } catch(e) {
525 - console.log("Could not access iframe content");
526 - }
527 - });
528 -
529 - try {
530 - if (iframe.contentDocument && iframe.contentDocument.documentElement) {
531 - iframe.contentDocument.documentElement.setAttribute("frame-adminify-iframe", "true");
532 - }
533 - } catch(e) {
534 - // Cross-origin restrictions might prevent access
535 - }
536 - }
537 - });
538 - document.addEventListener("DOMContentLoaded", function() {
539 - var menuItems = document.querySelectorAll(".wp-adminify.adminify-ui .adminify-toolbar-wrapper .adminify-toolbar .adminify-top-menu li");
540 - menuItems.forEach(function(item) {
541 - var link = item.querySelector("a");
542 - var divInLink = item.querySelector("a > div");
543 - if (link && divInLink) {
544 - link.textContent = divInLink.textContent;
545 - }
546 - });
547 - });
548 - </script>';
549 - }
550 62 // Third Party Plugin CSS Conflict
551 - // $pxlbsadminify_plugin_conflict_css = '';
63 + // $jltwp_adminify_plugin_conflict_css = '';
552 64 // if (Utils::is_plugin_active('quillforms/quillforms.php')) {
553 - // $pxlbsadminify_plugin_conflict_css = '//css code here';
554 - // $pxlbsadminify_plugin_conflict_css = preg_replace('#/\*.*?\*/#s', '', $pxlbsadminify_plugin_conflict_css);
555 - // $pxlbsadminify_plugin_conflict_css = preg_replace('/\s*([{}|:;,])\s+/', '$1', $pxlbsadminify_plugin_conflict_css);
556 - // $pxlbsadminify_plugin_conflict_css = preg_replace('/\s\s+(.*)/', '$1', $pxlbsadminify_plugin_conflict_css);
65 + // $jltwp_adminify_plugin_conflict_css = '//css code here';
66 + // $jltwp_adminify_plugin_conflict_css = preg_replace('#/\*.*?\*/#s', '', $jltwp_adminify_plugin_conflict_css);
67 + // $jltwp_adminify_plugin_conflict_css = preg_replace('/\s*([{}|:;,])\s+/', '$1', $jltwp_adminify_plugin_conflict_css);
68 + // $jltwp_adminify_plugin_conflict_css = preg_replace('/\s\s+(.*)/', '$1', $jltwp_adminify_plugin_conflict_css);
557 69 // }
558 70 // $adminify_ui = AdminSettings::get_instance()->get('admin_ui');
559 71 // if (!empty($adminify_ui)) {
560 - // wp_add_inline_style('wp-adminify-admin', wp_strip_all_tags($pxlbsadminify_plugin_conflict_css));
72 + // wp_add_inline_style('wp-adminify-admin', wp_strip_all_tags($jltwp_adminify_plugin_conflict_css));
561 73 // } else {
562 - // wp_add_inline_style('wp-adminify-default-ui', wp_strip_all_tags($pxlbsadminify_plugin_conflict_css));
74 + // wp_add_inline_style('wp-adminify-default-ui', wp_strip_all_tags($jltwp_adminify_plugin_conflict_css));
563 75 // }
564 76 if ( Utils::is_plugin_active( 'stackable-ultimate-gutenberg-blocks-premium/plugin.php' ) ) {
565 - echo '<style>
77 + echo '<style>
566 78 .wp-adminify.adminify-ui #wpcontent .wp-adminify.adminify-top_bar {
567 79 opacity: 1 !important;
568 80 }
569 - </style>';
81 + </style>' ;
570 82 }
571 83 if ( Utils::is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
572 - echo '<style>
573 - .adminify-ui #woocommerce-embedded-root .woocommerce-layout__header, .adminify-ui .woocommerce-layout .woocommerce-layout__header {
574 - width: 100%;
575 - top: 0;
576 - }
577 - .adminify-ui #woocommerce-embedded-root .woocommerce-layout__header .woocommerce-layout__header-wrapper, .adminify-ui .woocommerce-layout .woocommerce-layout__header .woocommerce-layout__header-wrapper {
578 - margin-right: 1rem;
579 - }
580 - body.woocommerce-page #wpwrap #wpcontent,
581 - body.woocommerce-page.woocommerce_page_wc-admin #wpwrap #wpbody-content {
582 - overflow-x: unset !important;
583 - position: unset !important;
584 - }
585 - </style>';
84 + echo '<style>
85 + body.woocommerce-page #wpwrap #wpcontent,
86 + body.woocommerce-page.woocommerce_page_wc-admin #wpwrap #wpbody-content {
87 + overflow-x: unset !important;
88 + position: unset !important;
89 + }
90 + </style>' ;
586 91 }
587 92 if ( Utils::is_plugin_active( 'tinymce-templates/tinymce-templates.php' ) ) {
588 - echo '<style>#tinymce-templates-wrap #tinymce-templates-preview { height: 500px !important; }</style>';
93 + echo '<style>#tinymce-templates-wrap #tinymce-templates-preview { height: 500px !important; }</style>' ;
589 94 }
590 95 if ( Utils::is_plugin_active( 'elementor/elementor.php' ) ) {
591 - echo '<style>
96 + echo '<style>
592 97 body.wp-adminify-admin-bar.admin-bar .dialog-lightbox-widget {
593 98 height: calc(100vh - 0px) !important;
594 99 }
595 100 body.wp-adminify-admin-bar.admin-bar #e-admin-top-bar-root{
@@ -599,24 +104,19 @@
599 104 }
600 105 body.wp-adminify-admin-bar.admin-bar #e-admin-top-bar-root .e-admin-top-bar{
601 106 padding-left: 20px;
602 107 }
603 -
604 - body.adminify-ui.e-has-sidebar-navigation #wpwrap #wpcontent #editor-one-top-bar > header {
605 - top: 0!important;
606 - }
607 - body.adminify-ui #wpbody-content #elementor-home-app main header {top: 0!important}
608 - </style>';
108 + </style>' ;
609 109 }
610 110 if ( Utils::is_plugin_active( 'one-click-demo-import/one-click-demo-import.php' ) ) {
611 - echo '<style>
111 + echo '<style>
612 112 .wp-adminify.appearance_page_one-click-demo-import .button-hero {
613 113 min-height: auto !important;
614 114 }
615 - </style>';
115 + </style>' ;
616 116 }
617 117 if ( Utils::is_plugin_active( 'wpforms-lite/wpforms.php' ) ) {
618 - if ( Utils::currentpage_id( 'dashboard' ) ) {
118 + if ( Utils::jltwp_adminify_currentpage_id( 'dashboard' ) ) {
619 119 wp_enqueue_style(
620 120 'wpforms-full',
621 121 WPFORMS_PLUGIN_URL . 'assets/css/frontend/classic/wpforms-full.css',
622 122 [],
@@ -624,9 +124,9 @@
624 124 );
625 125 }
626 126 }
627 127 if ( Utils::is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
628 - echo '<style>
128 + echo '<style>
629 129 #ed_toolbar{
630 130 width: 100% !important;
631 131 }
632 132 #ed_toolbar #qt_content_dfw{
@@ -632,12 +132,12 @@
632 132 #ed_toolbar #qt_content_dfw{
633 133 line-height: inherit;
634 134 padding: 0;
635 135 }
636 - </style>';
136 + </style>' ;
637 137 }
638 138 if ( Utils::is_plugin_active( 'updraftplus/updraftplus.php' ) ) {
639 - echo '<style>
139 + echo '<style>
640 140 .wp-adminify.settings_page_updraftplus input{
641 141 border-radius: 4px !important;
642 142 border: 1px solid #CCC !important;
643 143 }
@@ -657,12 +157,12 @@
657 157 }
658 158 .wp-adminify.adminify-dark-mode .expertmode .advanced_settings_container .advanced_settings_menu .advanced_tools_button{
659 159 color: inherit;
660 160 }
661 - </style>';
161 + </style>' ;
662 162 }
663 163 if ( Utils::is_plugin_active( 'tinymce-advanced/tinymce-advanced.php' ) ) {
664 - echo '<style>
164 + echo '<style>
665 165 .wp-editor-container .mce-container-body .mce-menubar.mce-toolbar{
666 166 position: initial !important;
667 167 }
668 168 .wp-editor-container .mce-container-body .mce-toolbar-grp .mce-container-body{
@@ -677,98 +177,27 @@
677 177 #ed_toolbar #qt_content_dfw{
678 178 line-height: inherit;
679 179 padding: 0;
680 180 }
681 - </style>';
181 + </style>' ;
682 182 }
683 - if ( Utils::is_plugin_active( 'email-template-customizer-for-woo/email-template-customizer-for-woo.php' ) ) {
684 - if ( $screen->id === 'edit-viwec_template' ) {
685 - echo '<style>
686 - #wpfooter{
687 - position: relative !important;
688 - display: flex;
689 - flex-direction: column-reverse;
690 - }
691 - </style>';
692 - }
693 - }
694 - if ( Utils::is_plugin_active( 'woocommerce-orders-tracking/woocommerce-orders-tracking.php' ) ) {
695 - if ( $screen->id === 'woocommerce_page_wc-orders' ) {
696 - echo '<style>
697 - #wpfooter{
698 - position: relative !important;
699 - display: block !important;
700 - flex-direction: column-reverse;
701 - }
702 - </style>';
703 - }
704 - }
705 - // Divi Theme - "Edit With Divi" link should reload parent page instead of iframe
706 - if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ) {
707 - echo '<script>
708 - document.addEventListener("DOMContentLoaded", function() {
709 - var iframe = document.getElementById("frame-adminify-app--iframe");
710 - if (!iframe) return;
711 -
712 - function handleDiviLinks(iframeDoc) {
713 - var diviLinks = iframeDoc.querySelectorAll("a[href*=\\"et_fb=1\\"], a.et_pb_toggle_builder_wrapper, a[href*=\\"page=et_divi_options\\"]");
714 - diviLinks.forEach(function(link) {
715 - link.addEventListener("click", function(e) {
716 - e.preventDefault();
717 - e.stopPropagation();
718 - window.top.location.href = link.href;
719 - });
720 - });
721 - }
722 -
723 - iframe.addEventListener("load", function() {
724 - try {
725 - var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
726 - handleDiviLinks(iframeDoc);
727 -
728 - var observer = new MutationObserver(function() {
729 - handleDiviLinks(iframeDoc);
730 - });
731 - observer.observe(iframeDoc.body, { childList: true, subtree: true });
732 - } catch(e) {
733 - console.log("Divi compatibility: Cannot access iframe content");
734 - }
735 - });
736 - });
737 - </script>';
738 - echo '<style>
739 - #adminify-top-menu-et-builder-shortcode-framework,
740 - #adminify-top-menu-et-builder-shortcode-framework-loaded,
741 - #adminify-top-menu-et-builder-shortcode-framework-option,
742 - #adminify-top-menu-et-builder-shortcode-framework-constant,
743 - #adminify-top-menu-et-builder-shortcode-framework-hook,
744 - #adminify-top-menu-et-builder-shortcode-framework-constant-value {
745 - display: none;
746 - }
747 - </style>';
748 - }
749 - if ( Utils::is_plugin_active( 'js_composer/js_composer.php' ) ) {
750 - echo '<style>
751 - .adminify-ui .vc_dropdown-list-item p{
752 - color: #fff;
753 - }
754 - </style>';
755 - }
756 183 // Third Party localize script
757 - wp_localize_script( 'adminify-admin', 'PXLBSADMINIFY_THIRDPARTY', $this->thirdparty_create_js_object() );
184 + wp_localize_script( 'wp-adminify-admin', 'WPAdminify_ThirdParty', $this->thirdparty_create_js_object() );
758 185 }
759 -
760 - public function thirdparty_create_js_object() {
186 +
187 + public function thirdparty_create_js_object()
188 + {
761 189 // betterlinks menu settings
762 190 $betterlinks = [
763 191 'active' => false,
764 192 ];
765 193 if ( Utils::is_plugin_active( 'betterlinks/betterlinks.php' ) ) {
194 +
766 195 if ( is_array( $this->menu_settings ) && array_key_exists( 'betterlinks', $this->menu_settings ) ) {
767 - $menu_name = ( !empty( $this->menu_settings['betterlinks']['name'] ) ? esc_html( $this->menu_settings['betterlinks']['name'] ) : '' );
768 - $submenu_manage = ( !empty( $this->menu_settings['betterlinks']['submenu']['betterlinks']['name'] ) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks']['name'] ) : '' );
769 - $submenu_name = ( !empty( $this->menu_settings['betterlinks']['submenu']['betterlinks-analytics']['name'] ) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks-analytics']['name'] ) : '' );
770 - $submenu_settings = ( !empty( $this->menu_settings['betterlinks']['submenu']['betterlinks-settings']['name'] ) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks-settings']['name'] ) : '' );
196 + $menu_name = ( !empty($this->menu_settings['betterlinks']['name']) ? esc_html( $this->menu_settings['betterlinks']['name'] ) : '' );
197 + $submenu_manage = ( !empty($this->menu_settings['betterlinks']['submenu']['betterlinks']['name']) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks']['name'] ) : '' );
198 + $submenu_name = ( !empty($this->menu_settings['betterlinks']['submenu']['betterlinks-analytics']['name']) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks-analytics']['name'] ) : '' );
199 + $submenu_settings = ( !empty($this->menu_settings['betterlinks']['submenu']['betterlinks-settings']['name']) ? esc_html( $this->menu_settings['betterlinks']['submenu']['betterlinks-settings']['name'] ) : '' );
771 200 $betterlinks = [
772 201 'active' => true,
773 202 'menu_name' => esc_html( $menu_name ),
774 203 'submenu_manage' => esc_html( $submenu_manage ),
@@ -775,8 +204,9 @@
775 204 'submenu_name' => esc_html( $submenu_name ),
776 205 'submenu_settings' => esc_html( $submenu_settings ),
777 206 ];
778 207 }
208 +
779 209 }
780 210 return [
781 211 'ajax_url' => admin_url( 'admin-ajax.php' ),
782 212 'better_links' => wp_kses_post_deep( $betterlinks ),
@@ -781,44 +211,49 @@
781 211 'ajax_url' => admin_url( 'admin-ajax.php' ),
782 212 'better_links' => wp_kses_post_deep( $betterlinks ),
783 213 ];
784 214 }
785 -
786 - public function register_actions_on_init() {
215 +
216 + public function register_actions_on_init()
217 + {
787 218 // Brizy Builder
788 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check, no state change.
219 +
789 220 if ( isset( $_REQUEST['brizy-edit-iframe'] ) ) {
790 - add_filter( 'pxlbsadminify_defer_skip', '__return_true' );
791 - add_filter( 'pxlbsadminify_skip_removing_dashicons', '__return_true' );
221 + add_filter( 'wp_adminify_defer_skip', '__return_true' );
222 + add_filter( 'wp_adminify_skip_removing_dashicons', '__return_true' );
792 223 }
224 +
793 225 }
794 -
795 - public function register_actions_on_admin_init() {
226 +
227 + public function register_actions_on_admin_init()
228 + {
796 229 $adminify_ui = AdminSettings::get_instance()->get( 'admin_ui' );
797 - if ( !empty( $adminify_ui ) ) {
798 - // Commented On: 24-3-24
799 - add_action( 'admin_enqueue_scripts', [$this, 'enqueue_scripts'], 999 );
230 +
231 + if ( !empty($adminify_ui) ) {
232 + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ], 999 );
233 + // 24-3-24
800 234 }
801 - // Commented On: 10-6-24
802 - // add_filter('pxlbsadminify_third_party_styles', [$this, 'register_compatability_styles']);
235 +
236 + add_filter( 'adminify_third_party_styles', [ $this, 'register_compatability_styles' ] );
803 237 // Fluent CRM
804 238 add_action( 'fluentcrm_skip_no_conflict', '__return_true' );
805 239 // Fluent FORM
806 240 add_action( 'fluentform_skip_no_conflict', '__return_true' );
807 241 }
808 -
242 +
809 243 /**
810 244 * Register Third Party Styles
811 245 *
812 246 * @since 1.0.0
813 247 */
814 - public function register_compatability_styles( $plugin_supports ) {
248 + public function register_compatability_styles( $plugin_supports )
249 + {
815 250 if ( !is_array( $plugin_supports ) ) {
816 251 $plugin_supports = [];
817 252 }
818 - $plugin_dir = PXLBSADMINIFY_ASSETS . 'css/plugins/';
819 - $plugin_files = list_files( PXLBSADMINIFY_PATH . 'assets/css/plugins/', 1 );
820 - if ( !empty( $plugin_files ) ) {
253 + $plugin_dir = WP_ADMINIFY_ASSETS . 'css/plugins/';
254 + $plugin_files = list_files( WP_ADMINIFY_PATH . 'assets/css/plugins/', 1 );
255 + if ( !empty($plugin_files) ) {
821 256 foreach ( $plugin_files as $file ) {
822 257 $plugin_supports[wp_basename( $file, '.min.css' )] = $plugin_dir . wp_basename( $file );
823 258 }
824 259 }
@@ -823,84 +258,67 @@
823 258 }
824 259 }
825 260 return $plugin_supports;
826 261 }
827 -
262 +
828 263 /**
829 264 * Admin Enqueue Third Party Scripts/Styles
830 265 *
831 266 * @return void
832 267 */
833 - public function enqueue_scripts() {
268 + public function enqueue_scripts()
269 + {
834 270 $plugin_supports = [];
835 - $plugin_supports = apply_filters( 'pxlbsadminify_third_party_styles', $plugin_supports );
271 + $plugin_supports = apply_filters( 'adminify_third_party_styles', $plugin_supports );
836 272 // Check Plugin Activated for Site Wide
273 +
837 274 if ( is_multisite() ) {
838 275 $active_plugins = get_site_option( 'active_sitewide_plugins' );
839 276 foreach ( $active_plugins as $active_path => $active_plugin ) {
277 +
840 278 if ( is_plugin_active_for_network( $active_path ) ) {
841 279 $string = explode( '/', $active_path );
842 280 $pluginname = $string[0];
843 281 if ( isset( $plugin_supports[$pluginname] ) ) {
282 +
844 283 if ( $plugin_supports[$pluginname] != '' ) {
845 284 wp_register_style(
846 - 'adminify_site-wide_' . $pluginname . '_css',
285 + 'wp-adminify_site-wide_' . $pluginname . '_css',
847 286 $plugin_supports[$pluginname],
848 287 [],
849 - PXLBSADMINIFY_VER
288 + WP_ADMINIFY_VER
850 289 );
851 - wp_enqueue_style( 'adminify_site-wide_' . $pluginname . '_css' );
290 + wp_enqueue_style( 'wp-adminify_site-wide_' . $pluginname . '_css' );
852 291 }
292 +
853 293 }
854 294 }
295 +
855 296 }
856 297 }
298 +
857 299 // Check Plugin Activated for Individual Sites
858 300 $activeplugins = get_option( 'active_plugins' );
859 301 foreach ( $activeplugins as $plugin ) {
302 +
860 303 if ( Utils::is_plugin_active( $plugin ) ) {
861 304 $string = explode( '/', $plugin );
862 305 $pluginname = $string[0];
863 306 if ( isset( $plugin_supports[$pluginname] ) ) {
307 +
864 308 if ( $plugin_supports[$pluginname] != '' ) {
865 309 wp_register_style(
866 - 'adminify_' . $pluginname . '_css',
310 + 'wp-adminify_' . $pluginname . '_css',
867 311 $plugin_supports[$pluginname],
868 312 [],
869 - PXLBSADMINIFY_VER
313 + WP_ADMINIFY_VER
870 314 );
871 - wp_enqueue_style( 'adminify_' . $pluginname . '_css' );
315 + wp_enqueue_style( 'wp-adminify_' . $pluginname . '_css' );
872 316 }
317 +
873 318 }
874 319 }
320 +
875 321 }
876 322 }
877 323
878 - /**
879 - * Inject layout-tightening CSS INTO the WP 6.3+/7.0 block editor iframe canvas.
880 - *
881 - * The Gutenberg canvas runs inside an iframe; styles enqueued via
882 - * `enqueue_block_editor_assets` only reach the parent admin chrome. The
883 - * `block_editor_settings_all` `styles` array IS injected into the iframe.
884 - *
885 - * The default Gutenberg post-title wrapper carries large block padding which,
886 - * inside Adminify's iframe wrapper (already framed by topbar + sidebar),
887 - * reads as a huge dead area between the editor toolbar and "Add title".
888 - * Compress that wrapper + leading content padding so the title sits close
889 - * under the toolbar.
890 - */
891 - public function block_editor_iframe_layout_tweaks( $settings ) {
892 - // Iframe body padding (Gutenberg ~50-60px default) + root container's first-child
893 - // margin-block-start are the two real sources of the gap above "Add title".
894 - // Multiple selectors cover WP 6.x ("edit-post-*") and WP 7.0+ ("editor-*", new
895 - // "block-editor-iframe__body" body class on the iframe) class renames.
896 - $css = 'html body.block-editor-iframe__body,' . 'html body.editor-styles-wrapper,' . '.block-editor-iframe__body,' . '.editor-styles-wrapper{padding-top:12px !important;margin-top:0 !important;}' . '.is-root-container,' . '.editor-styles-wrapper>.is-root-container,' . '.block-editor-block-list__layout.is-root-container,' . '.is-root-container.is-layout-flow,' . '.is-root-container.is-layout-constrained{padding-top:0 !important;margin-top:0 !important;}' . '.is-root-container>*:first-child,' . '.is-root-container>[data-block]:first-child,' . '.editor-styles-wrapper>[data-block]:first-child,' . '.editor-styles-wrapper>.wp-block:first-child{margin-block-start:0 !important;margin-top:0 !important;padding-top:0 !important;}' . '.wp-block-post-title,' . 'h1.wp-block-post-title,' . '.editor-post-title,' . 'h1.editor-post-title,' . '.editor-post-title__input,' . 'h1.editor-post-title__input{margin:0 !important;margin-block-start:0 !important;padding-top:0 !important;}' . '.edit-post-visual-editor,' . '.editor-visual-editor,' . '.edit-post-visual-editor__post-title-wrapper,' . '.editor-visual-editor__post-title-wrapper,' . '.edit-post-visual-editor__content-area,' . '.editor-visual-editor__content-area{padding-top:0 !important;margin-top:0 !important;}';
897 - if ( !isset( $settings['styles'] ) || !is_array( $settings['styles'] ) ) {
898 - $settings['styles'] = array();
899 - }
900 - $settings['styles'][] = array(
901 - 'css' => $css,
902 - );
903 - return $settings;
904 - }
905 -
906 -}
324 +}