PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.4
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.4
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 / living-tree / assets.php

assets.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.4, at includes/living-tree/assets.php

40 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 — Living Tree: asset registration.
4 *
5 * Registers the `os-living-tree-wallpaper` script handle (built
6 * bundle `assets/js/living-tree-wallpaper[.min].js`). The wallpaper
7 * `server-sync` lazy-loads it when the user selects the `wp-living-tree`
8 * wallpaper (or opens OS Settings → Wallpaper and the picker pulls the
9 * def in). The bundle's only side effect is publishing the `WallpaperDef`
10 * on `window.openStationWallpapers['wp-living-tree']`. Mirrors the
11 * animated-logo block in `includes/assets.php`.
12 *
13 * @package OpenStation
14 */
15
16 defined( 'ABSPATH' ) || exit;
17
18 /**
19 * Register the Living Tree wallpaper script handle.
20 */
21 function openstation_living_tree_register_assets() {
22 $version = OPENSTATION_VERSION;
23 $suffix = openstation_asset_suffix();
24
25 $js_path = OPENSTATION_DIR . 'assets/js/living-tree-wallpaper' . $suffix . '.js';
26 wp_register_script(
27 'os-living-tree-wallpaper',
28 OPENSTATION_URL . 'assets/js/living-tree-wallpaper' . $suffix . '.js',
29 array( 'wp-hooks', 'wp-i18n' ),
30 file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version,
31 true
32 );
33 wp_set_script_translations(
34 'os-living-tree-wallpaper',
35 'desktop-mode',
36 OPENSTATION_DIR . 'languages'
37 );
38 }
39 add_action( 'init', 'openstation_living_tree_register_assets', 5 );
40