PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.13
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.13
1.1.13 1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 All 37 releases
desktop-mode / includes / compat / elementor.php

elementor.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.13, at includes/compat/elementor.php

33 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor compatibility.
4 *
5 * @package OpenStation\Compat
6 */
7
8 defined( 'ABSPATH' ) || exit;
9
10 /**
11 * Hides Elementor 4's legacy menus from the dock. Elementor keeps its
12 * old "Elementor" menu and the Templates menu registered for their URLs
13 * and hides both from the classic sidebar with CSS the dock can't see.
14 * Keyed on the new `elementor-home` menu: before Elementor 4 these two
15 * are its only menus.
16 *
17 * @param string $placement Dock placement, `'dock'` or `'hidden'`.
18 * @param string $menu_slug Menu slug.
19 * @return string
20 */
21 function openstation_compat_elementor_dock_placement( $placement, $menu_slug ) {
22 if ( 'elementor' !== $menu_slug && 'edit.php?post_type=elementor_library' !== $menu_slug ) {
23 return $placement;
24 }
25 return empty( $GLOBALS['admin_page_hooks']['elementor-home'] ) ? $placement : 'hidden';
26 }
27 add_filter( 'openstation_dock_placement', 'openstation_compat_elementor_dock_placement', 10, 2 );
28
29 // Elementor's editor prints its own head, so `admin_head` never fires,
30 // and its Document-Isolation-Policy keeps the shell from reading the
31 // frame's location: this ping is how a window learns it shows the editor.
32 add_action( 'elementor/editor/wp_head', 'openstation_chromeless_navigation_ping_script' );
33