| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * otherwise repeat in every desktop window — into shell descriptors, so the |
| 5 | 5 | * shell can surface each once. The update nag is handled separately (see |
| 6 | 6 | * update-notice.php); this covers the rest. |
| 7 | 7 | * |
| 8 | - * @package DesktopMode | |
| 8 | + * @package OpenStation | |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| @@ -18,16 +18,16 @@ | ||
| 18 | 18 | * renders each as a persistent, dismissible toast. |
| 19 | 19 | * |
| 20 | 20 | * @return array<int,array{id:string,title:string,message:string,actionLabel:string,actionUrl:string}> |
| 21 | 21 | */ |
| 22 | -function desktop_mode_get_core_notices() { | |
| 22 | +function openstation_get_core_notices() { | |
| 23 | 23 | $builders = array( |
| 24 | - 'desktop_mode_core_notice_maintenance', | |
| 25 | - 'desktop_mode_core_notice_recovery_mode', | |
| 26 | - 'desktop_mode_core_notice_default_password', | |
| 27 | - 'desktop_mode_core_notice_deactivated_plugins', | |
| 28 | - 'desktop_mode_core_notice_paused_plugins', | |
| 29 | - 'desktop_mode_core_notice_paused_themes', | |
| 24 | + 'openstation_core_notice_maintenance', | |
| 25 | + 'openstation_core_notice_recovery_mode', | |
| 26 | + 'openstation_core_notice_default_password', | |
| 27 | + 'openstation_core_notice_deactivated_plugins', | |
| 28 | + 'openstation_core_notice_paused_plugins', | |
| 29 | + 'openstation_core_notice_paused_themes', | |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | $notices = array(); |
| 33 | 33 | foreach ( $builders as $builder ) { |
| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | * empty array to suppress them all, or unset individual entries by `id`. |
| 43 | 43 | * |
| 44 | 44 | * @param array $notices List of notice descriptors. |
| 45 | 45 | */ |
| 46 | - return apply_filters( 'desktop_mode_core_notices', $notices ); | |
| 46 | + return apply_filters( 'openstation_core_notices', $notices ); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Normalizes a notice descriptor, filling optional fields. |
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | * |
| 52 | 52 | * @param array $notice Partial descriptor with at least `id` + `message`. |
| 53 | 53 | * @return array{id:string,title:string,message:string,actionLabel:string,actionUrl:string} |
| 54 | 54 | */ |
| 55 | -function desktop_mode_core_notice( array $notice ) { | |
| 55 | +function openstation_core_notice( array $notice ) { | |
| 56 | 56 | return array( |
| 57 | 57 | 'id' => (string) $notice['id'], |
| 58 | 58 | 'title' => isset( $notice['title'] ) ? (string) $notice['title'] : '', |
| 59 | 59 | 'message' => (string) $notice['message'], |
| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | * Interrupted / failed automated core update — mirrors `maintenance_nag()`. |
| 67 | 67 | * |
| 68 | 68 | * @return array|null |
| 69 | 69 | */ |
| 70 | -function desktop_mode_core_notice_maintenance() { | |
| 70 | +function openstation_core_notice_maintenance() { | |
| 71 | 71 | $nag = isset( $GLOBALS['upgrading'] ); |
| 72 | 72 | |
| 73 | 73 | if ( ! $nag ) { |
| 74 | 74 | $failed = get_site_option( 'auto_core_update_failed' ); |
| @@ -84,9 +84,9 @@ | ||
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $can = current_user_can( 'update_core' ); |
| 88 | - return desktop_mode_core_notice( | |
| 88 | + return openstation_core_notice( | |
| 89 | 89 | array( |
| 90 | 90 | 'id' => 'maintenance', |
| 91 | 91 | 'title' => __( 'WordPress Updates', 'desktop-mode' ), |
| 92 | 92 | 'message' => $can |
| @@ -102,9 +102,9 @@ | ||
| 102 | 102 | * Site is in recovery mode — mirrors `wp_recovery_mode_nag()`. |
| 103 | 103 | * |
| 104 | 104 | * @return array|null |
| 105 | 105 | */ |
| 106 | -function desktop_mode_core_notice_recovery_mode() { | |
| 106 | +function openstation_core_notice_recovery_mode() { | |
| 107 | 107 | if ( ! function_exists( 'wp_is_recovery_mode' ) || ! wp_is_recovery_mode() ) { |
| 108 | 108 | return null; |
| 109 | 109 | } |
| 110 | 110 | |
| @@ -111,9 +111,9 @@ | ||
| 111 | 111 | $url = wp_login_url(); |
| 112 | 112 | $url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url ); |
| 113 | 113 | $url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION ); |
| 114 | 114 | |
| 115 | - return desktop_mode_core_notice( | |
| 115 | + return openstation_core_notice( | |
| 116 | 116 | array( |
| 117 | 117 | 'id' => 'recovery-mode', |
| 118 | 118 | 'title' => __( 'Recovery Mode', 'desktop-mode' ), |
| 119 | 119 | 'message' => __( 'You are in recovery mode. There may be an error with a theme or plugin.', 'desktop-mode' ), |
| @@ -128,14 +128,14 @@ | ||
| 128 | 128 | * `default_password_nag()`. |
| 129 | 129 | * |
| 130 | 130 | * @return array|null |
| 131 | 131 | */ |
| 132 | -function desktop_mode_core_notice_default_password() { | |
| 132 | +function openstation_core_notice_default_password() { | |
| 133 | 133 | if ( ! get_user_option( 'default_password_nag' ) ) { |
| 134 | 134 | return null; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - return desktop_mode_core_notice( | |
| 137 | + return openstation_core_notice( | |
| 138 | 138 | array( |
| 139 | 139 | 'id' => 'default-password', |
| 140 | 140 | 'title' => __( 'Profile', 'desktop-mode' ), |
| 141 | 141 | 'message' => __( 'You are using an auto-generated password. Would you like to change it?', 'desktop-mode' ), |
| @@ -150,9 +150,9 @@ | ||
| 150 | 150 | * `deactivated_plugins_notice()`. |
| 151 | 151 | * |
| 152 | 152 | * @return array|null |
| 153 | 153 | */ |
| 154 | -function desktop_mode_core_notice_deactivated_plugins() { | |
| 154 | +function openstation_core_notice_deactivated_plugins() { | |
| 155 | 155 | if ( ! current_user_can( 'activate_plugins' ) ) { |
| 156 | 156 | return null; |
| 157 | 157 | } |
| 158 | 158 | |
| @@ -170,9 +170,9 @@ | ||
| 170 | 170 | if ( ! $names ) { |
| 171 | 171 | return null; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - return desktop_mode_core_notice( | |
| 174 | + return openstation_core_notice( | |
| 175 | 175 | array( |
| 176 | 176 | 'id' => 'deactivated-plugins', |
| 177 | 177 | 'title' => __( 'Plugins', 'desktop-mode' ), |
| 178 | 178 | 'message' => sprintf( |
| @@ -190,9 +190,9 @@ | ||
| 190 | 190 | * Plugins paused by recovery mode — mirrors `paused_plugins_notice()`. |
| 191 | 191 | * |
| 192 | 192 | * @return array|null |
| 193 | 193 | */ |
| 194 | -function desktop_mode_core_notice_paused_plugins() { | |
| 194 | +function openstation_core_notice_paused_plugins() { | |
| 195 | 195 | if ( ! current_user_can( 'resume_plugins' ) || ! function_exists( 'wp_paused_plugins' ) ) { |
| 196 | 196 | return null; |
| 197 | 197 | } |
| 198 | 198 | |
| @@ -199,9 +199,9 @@ | ||
| 199 | 199 | if ( empty( wp_paused_plugins()->get_all() ) ) { |
| 200 | 200 | return null; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - return desktop_mode_core_notice( | |
| 203 | + return openstation_core_notice( | |
| 204 | 204 | array( |
| 205 | 205 | 'id' => 'paused-plugins', |
| 206 | 206 | 'title' => __( 'Plugins', 'desktop-mode' ), |
| 207 | 207 | 'message' => __( 'One or more plugins failed to load properly.', 'desktop-mode' ), |
| @@ -215,9 +215,9 @@ | ||
| 215 | 215 | * Themes paused by recovery mode — mirrors `paused_themes_notice()`. |
| 216 | 216 | * |
| 217 | 217 | * @return array|null |
| 218 | 218 | */ |
| 219 | -function desktop_mode_core_notice_paused_themes() { | |
| 219 | +function openstation_core_notice_paused_themes() { | |
| 220 | 220 | if ( ! current_user_can( 'resume_themes' ) || ! function_exists( 'wp_paused_themes' ) ) { |
| 221 | 221 | return null; |
| 222 | 222 | } |
| 223 | 223 | |
| @@ -224,9 +224,9 @@ | ||
| 224 | 224 | if ( empty( wp_paused_themes()->get_all() ) ) { |
| 225 | 225 | return null; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - return desktop_mode_core_notice( | |
| 228 | + return openstation_core_notice( | |
| 229 | 229 | array( |
| 230 | 230 | 'id' => 'paused-themes', |
| 231 | 231 | 'title' => __( 'Themes', 'desktop-mode' ), |
| 232 | 232 | 'message' => __( 'One or more themes failed to load properly.', 'desktop-mode' ), |