PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
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 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / includes / core / class-openstation-silent-admin-bar.php

class-openstation-silent-admin-bar.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.10, at includes/core/class-openstation-silent-admin-bar.php

39 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation — the admin bar a window builds instead of the real one.
4 *
5 * **This file is required lazily, not at bootstrap.** It extends
6 * `WP_Admin_Bar`, which WordPress only loads inside
7 * `_wp_admin_bar_init()` — requiring this at plugin load would fatal
8 * on a missing parent. The `wp_admin_bar_class` filter runs *after*
9 * that require, which is the one moment the parent is guaranteed
10 * present, so {@see openstation_chromeless_silence_admin_bar()} pulls
11 * this file in there.
12 *
13 * @package OpenStation
14 */
15
16 defined( 'ABSPATH' ) || exit;
17
18 /**
19 * A `WP_Admin_Bar` that never asks anyone for nodes.
20 *
21 * Fully functional in every other respect — `add_node()` works,
22 * `get_nodes()` answers, `$wp_admin_bar` stays a real object — so a
23 * plugin that touches the global outside the `admin_bar_menu` hook
24 * finds what it expects. Only the solicitation is skipped.
25 */
26 class OpenStation_Silent_Admin_Bar extends WP_Admin_Bar {
27
28 /**
29 * Skips the `admin_bar_menu` hook.
30 *
31 * The parent's `add_menus()` registers core's twenty-odd node
32 * callbacks and then fires `admin_bar_menu`, running every
33 * callback any plugin has on it — each resolving links, counting
34 * things, checking capabilities — to build a bar this window
35 * never draws.
36 */
37 public function add_menus() {}
38 }
39