# desktop-mode/0.9.2/includes/render/body-classes.php

OpenStation: Desktop Windows, Dock &amp; Virtual Desktops for WP Admin, version 0.9.2. 50 lines.

- Page: https://pluginprobe.com/plugins/desktop-mode/0.9.2/code/includes/render/body-classes.php
- Raw: https://pluginprobe.com/plugins/desktop-mode/0.9.2/raw/includes/render/body-classes.php
- Modified: 2026-05-08T19:30:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/desktop-mode/0.9.2/code/includes/render/body-classes.php#L10-L20`.

```php
<?php
/**
 * Desktop Mode — Body class tagging.
 *
 * Adds `desktop-mode-active` / `desktop-mode-chromeless` to the
 * admin body class so the shell CSS and the chromeless overrides
 * stylesheet can key off it. Per-request `?desktop_mode_classic=1`
 * suppresses both classes for the detached-tab workflow.
 *
 * Extracted from the 2,525-LOC `render.php` during the
 * architecture-0.8.1 PHP slicing (phase 6).
 *
 * @package Desktop_Mode
 * @since   0.8.1
 */

defined( 'ABSPATH' ) || exit;

/**
 * Adds body classes for desktop mode and chromeless iframes.
 *
 * The classes anchor all CSS in the shell and chromeless overrides
 * stylesheets — `.desktop-mode-active` hides classic chrome and reveals
 * the shell, `.desktop-mode-chromeless` reshapes the page inside iframes.
 *
 * @since 0.1.0
 *
 * @param string $classes Space-separated CSS class string.
 * @return string
 */
function desktop_mode_admin_body_classes( $classes ) {
	if ( desktop_mode_is_chromeless_request() ) {
		return ltrim( $classes . ' desktop-mode-chromeless' );
	}

	// Per-request classic override: don't tag the body as desktop-active so
	// the classic chrome isn't hidden by CSS for this one tab.
	if ( desktop_mode_is_classic_request() ) {
		return $classes;
	}

	if ( desktop_mode_is_enabled() ) {
		return ltrim( $classes . ' desktop-mode-active' );
	}

	return $classes;
}
add_filter( 'admin_body_class', 'desktop_mode_admin_body_classes' );


```
