| @@ -1,16 +1,16 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Desktop Mode — Toast notification type registry. | |
| 3 | + * OpenStation — Toast notification type registry. | |
| 4 | 4 | * |
| 5 | 5 | * The shell surfaces user-visible toast notifications (save succeeded, |
| 6 | 6 | * upload failed, a plugin crashed, …). Each toast carries a `type` |
| 7 | 7 | * slug that the shell maps to a color + icon. The defaults cover |
| 8 | 8 | * `success`, `warning`, `error`, and `shell-error`; plugins and themes |
| 9 | - * extend the list via the {@see 'desktop_mode_toast_types'} filter to | |
| 9 | + * extend the list via the {@see 'openstation_toast_types'} filter to | |
| 10 | 10 | * register their own slugs (e.g. `update-available`). |
| 11 | 11 | * |
| 12 | - * @package WPDesktopMode | |
| 12 | + * @package OpenStation | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | defined( 'ABSPATH' ) || exit; |
| 16 | 16 | |
| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | * Returns the map of toast-notification type slugs shipped to the shell. |
| 19 | 19 | * |
| 20 | 20 | * Each entry is an array shaped `{ id, label, icon, tone }`: |
| 21 | 21 | * |
| 22 | - * - `id` is a stable slug plugins call with `wp.desktop.toast( id, … )`. | |
| 22 | + * - `id` is a stable slug plugins call with `wp.os.toast( id, … )`. | |
| 23 | 23 | * - `label` is the default aria-label used when a toast omits one. |
| 24 | 24 | * - `icon` is a Dashicons class rendered alongside the message. |
| 25 | 25 | * - `tone` is one of `positive | warning | critical | neutral` — the |
| 26 | 26 | * shell maps this to its color palette. |
| @@ -26,9 +26,9 @@ | ||
| 26 | 26 | * shell maps this to its color palette. |
| 27 | 27 | * |
| 28 | 28 | * @return array<int, array{id: string, label: string, icon: string, tone: string}> |
| 29 | 29 | */ |
| 30 | -function desktop_mode_get_toast_types() { | |
| 30 | +function openstation_get_toast_types() { | |
| 31 | 31 | $defaults = array( |
| 32 | 32 | array( |
| 33 | 33 | 'id' => 'success', |
| 34 | 34 | 'label' => __( 'Success', 'desktop-mode' ), |
| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | /** |
| 61 | 61 | * Filters the toast-notification type map. |
| 62 | 62 | * |
| 63 | 63 | * ```php |
| 64 | - * add_filter( 'desktop_mode_toast_types', function ( $types ) { | |
| 64 | + * add_filter( 'openstation_toast_types', function ( $types ) { | |
| 65 | 65 | * $types[] = array( |
| 66 | 66 | * 'id' => 'update-available', |
| 67 | 67 | * 'label' => __( 'Update available', 'my-plugin' ), |
| 68 | 68 | * 'icon' => 'dashicons-update', |
| @@ -79,9 +79,9 @@ | ||
| 79 | 79 | * `label` falls back to the ucfirst'd `id`. |
| 80 | 80 | * |
| 81 | 81 | * @param array $defaults Built-in toast types. |
| 82 | 82 | */ |
| 83 | - $filtered = apply_filters( 'desktop_mode_toast_types', $defaults ); | |
| 83 | + $filtered = apply_filters( 'openstation_toast_types', $defaults ); | |
| 84 | 84 | if ( ! is_array( $filtered ) ) { |
| 85 | 85 | return $defaults; |
| 86 | 86 | } |
| 87 | 87 | |