PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 0.8.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v0.8.8
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 / desktop-files / built-in-openers.php

built-in-openers.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 0.8.8, at includes/desktop-files/built-in-openers.php

88 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Desktop Mode — built-in file-opener registrations.
4 *
5 * Ships one default opener per built-in file type so the user can
6 * double-click any tile and have something happen out of the box.
7 * Each entry registers PHP-side metadata; the actual handler that
8 * builds the URL or opens the window lives in the JS bundle (see
9 * `src/desktop-files/built-in-openers.ts`).
10 *
11 * Hooked on `init` priority 6 — after the file-type registry
12 * (priority 5) and before the shell config is built. Same ordering
13 * as the wallpapers / icons modules.
14 *
15 * @package WPDesktopMode
16 * @since 0.9.0
17 */
18
19 defined( 'ABSPATH' ) || exit;
20
21 /**
22 * Registers the built-in openers (one per file type).
23 *
24 * @since 0.9.0
25 */
26 function desktop_mode_register_builtin_file_openers() {
27 $openers = array(
28 array(
29 'id' => 'wp-post-editor',
30 'label' => __( 'Block Editor', 'desktop-mode' ),
31 'types' => array( 'post' ),
32 'sort' => 10,
33 ),
34 array(
35 'id' => 'wp-media-editor',
36 'label' => __( 'Media editor', 'desktop-mode' ),
37 'types' => array( 'attachment' ),
38 'sort' => 10,
39 ),
40 array(
41 'id' => 'wp-user-profile',
42 'label' => __( 'User profile', 'desktop-mode' ),
43 'types' => array( 'user' ),
44 'sort' => 10,
45 ),
46 array(
47 'id' => 'wp-term-editor',
48 'label' => __( 'Term editor', 'desktop-mode' ),
49 'types' => array( 'term' ),
50 'sort' => 10,
51 ),
52 array(
53 'id' => 'wp-comment-editor',
54 'label' => __( 'Comment editor', 'desktop-mode' ),
55 'types' => array( 'comment' ),
56 'sort' => 10,
57 ),
58 array(
59 'id' => 'browser-navigate',
60 'label' => __( 'Open in browser', 'desktop-mode' ),
61 'types' => array( 'bookmark' ),
62 'sort' => 10,
63 ),
64 array(
65 'id' => 'desktop-mode-link-opener',
66 'label' => __( 'Open in browser', 'desktop-mode' ),
67 'types' => array( 'link' ),
68 'sort' => 10,
69 ),
70 array(
71 'id' => 'desktop-mode-embed-opener',
72 'label' => __( 'Open as window', 'desktop-mode' ),
73 'types' => array( 'embed' ),
74 'sort' => 10,
75 ),
76 );
77
78 foreach ( $openers as $args ) {
79 desktop_mode_register_file_opener( $args['id'], array(
80 'label' => $args['label'],
81 'types' => $args['types'],
82 'is_default' => true,
83 'sort' => $args['sort'],
84 ) );
85 }
86 }
87 add_action( 'init', 'desktop_mode_register_builtin_file_openers', 6 );
88