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