PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 0.8.7
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v0.8.7
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-types.php

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

96 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-type registrations.
4 *
5 * Registers the seven file types that ship with the plugin
6 * through the same public API third-party plugins use. Hooked on
7 * `init` priority 5 so the types land in the registry before the
8 * shell config is built and before any third-party plugin that
9 * wants to react via `desktop_mode_file_type_registered`.
10 *
11 * @package WPDesktopMode
12 * @since 0.9.0
13 */
14
15 defined( 'ABSPATH' ) || exit;
16
17 /**
18 * Registers the built-in file types (post, user, attachment,
19 * term, comment, folder, bookmark).
20 *
21 * @since 0.9.0
22 */
23 function desktop_mode_register_builtin_file_types() {
24 $types = array(
25 array(
26 'type' => 'post',
27 'label' => __( 'Post', 'desktop-mode' ),
28 'class' => 'Desktop_Mode_Post_File',
29 'sort' => 10,
30 ),
31 array(
32 'type' => 'attachment',
33 'label' => __( 'Media', 'desktop-mode' ),
34 'class' => 'Desktop_Mode_Attachment_File',
35 'sort' => 20,
36 ),
37 array(
38 'type' => 'user',
39 'label' => __( 'User', 'desktop-mode' ),
40 'class' => 'Desktop_Mode_User_File',
41 'sort' => 30,
42 ),
43 array(
44 'type' => 'term',
45 'label' => __( 'Taxonomy term', 'desktop-mode' ),
46 'class' => 'Desktop_Mode_Term_File',
47 'sort' => 40,
48 ),
49 array(
50 'type' => 'comment',
51 'label' => __( 'Comment', 'desktop-mode' ),
52 'class' => 'Desktop_Mode_Comment_File',
53 'sort' => 50,
54 ),
55 array(
56 'type' => 'bookmark',
57 'label' => __( 'Bookmark', 'desktop-mode' ),
58 'class' => 'Desktop_Mode_Bookmark_File',
59 'sort' => 60,
60 ),
61 array(
62 'type' => 'folder',
63 'label' => __( 'Folder', 'desktop-mode' ),
64 'class' => 'Desktop_Mode_Folder_File',
65 'sort' => 5,
66 ),
67 array(
68 'type' => 'shortcut',
69 'label' => __( 'Plugin shortcut', 'desktop-mode' ),
70 'class' => 'Desktop_Mode_Shortcut_File',
71 'sort' => 1,
72 ),
73 array(
74 'type' => 'link',
75 'label' => __( 'Web link', 'desktop-mode' ),
76 'class' => 'Desktop_Mode_Link_File',
77 'sort' => 70,
78 ),
79 array(
80 'type' => 'embed',
81 'label' => __( 'Embedded web window', 'desktop-mode' ),
82 'class' => 'Desktop_Mode_Embed_File',
83 'sort' => 80,
84 ),
85 );
86
87 foreach ( $types as $args ) {
88 desktop_mode_register_file_type( $args['type'], array(
89 'label' => $args['label'],
90 'class' => $args['class'],
91 'sort' => $args['sort'],
92 ) );
93 }
94 }
95 add_action( 'init', 'desktop_mode_register_builtin_file_types', 5 );
96