| @@ -77,8 +77,15 @@ | ||
| 77 | 77 | * Settings when the wallpaper is the |
| 78 | 78 | * active selection — what it is, where |
| 79 | 79 | * its data comes from, the story behind |
| 80 | 80 | * it. Optional. |
| 81 | + * @type string $tone 'light' | 'dark'. Whether the desk | |
| 82 | + * paints its icons and labels in | |
| 83 | + * Starlight or in Void. Optional; | |
| 84 | + * unset reads as 'dark'. Declare | |
| 85 | + * 'light' if a user would call your | |
| 86 | + * surface pale. See | |
| 87 | + * docs/desktop-themes.md. | |
| 81 | 88 | * @type string[] $capabilities Gate: ALL caps must match. Any |
| 82 | 89 | * missed cap returns |
| 83 | 90 | * `WP_Error openstation_capability_denied`. |
| 84 | 91 | * } |
| @@ -99,8 +106,9 @@ | ||
| 99 | 106 | 'type' => 'canvas', |
| 100 | 107 | 'value' => '', |
| 101 | 108 | 'script' => '', |
| 102 | 109 | 'description' => '', |
| 110 | + 'tone' => '', | |
| 103 | 111 | 'capabilities' => array(), |
| 104 | 112 | ); |
| 105 | 113 | $args = wp_parse_args( $args, $defaults ); |
| 106 | 114 | |
| @@ -170,8 +178,11 @@ | ||
| 170 | 178 | 'script' => (string) $args['script'], |
| 171 | 179 | // Plain text by contract — the shell renders it as text, never |
| 172 | 180 | // as HTML, so strip tags here rather than trusting every caller. |
| 173 | 181 | 'description' => sanitize_textarea_field( (string) $args['description'] ), |
| 182 | + // Anything else stores empty and reads as 'dark', so a typo | |
| 183 | + // lands on the old look rather than on invisible icons. | |
| 184 | + 'tone' => in_array( $args['tone'], array( 'light', 'dark' ), true ) ? (string) $args['tone'] : '', | |
| 174 | 185 | ); |
| 175 | 186 | openstation_desktop_wallpaper_registry( $id, $entry ); |
| 176 | 187 | |
| 177 | 188 | /** |
| @@ -244,8 +255,9 @@ | ||
| 244 | 255 | 'preview' => isset( $entry['preview'] ) ? (string) $entry['preview'] : '', |
| 245 | 256 | 'type' => isset( $entry['type'] ) ? (string) $entry['type'] : 'canvas', |
| 246 | 257 | 'value' => isset( $entry['value'] ) ? (string) $entry['value'] : '', |
| 247 | 258 | 'description' => isset( $entry['description'] ) ? (string) $entry['description'] : '', |
| 259 | + 'tone' => isset( $entry['tone'] ) ? (string) $entry['tone'] : '', | |
| 248 | 260 | 'scriptUrl' => $payload['url'], |
| 249 | 261 | 'scriptHandle' => $handle, |
| 250 | 262 | 'scriptBefore' => $payload['before'], |
| 251 | 263 | 'scriptAfter' => $payload['after'], |