| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Reports a pending WordPress core update to the shell as the `coreUpdate` |
| 4 | 4 | * config value. The shell resolves the release art and renders the |
| 5 | 5 | * notification client-side (see `src/update-notice.ts`). |
| 6 | 6 | * |
| 7 | - * @package DesktopMode | |
| 7 | + * @package OpenStation | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | * @param string $installed Installed version. |
| 17 | 17 | * @param string $available Available version. |
| 18 | 18 | * @return bool |
| 19 | 19 | */ |
| 20 | -function desktop_mode_is_major_update( $installed, $available ) { | |
| 20 | +function openstation_is_major_update( $installed, $available ) { | |
| 21 | 21 | $branch = static function ( $v ) { |
| 22 | 22 | $p = explode( '.', (string) $v ); |
| 23 | 23 | return ( isset( $p[0] ) ? $p[0] : '0' ) . '.' . ( isset( $p[1] ) ? $p[1] : '0' ); |
| 24 | 24 | }; |
| @@ -30,9 +30,9 @@ | ||
| 30 | 30 | * |
| 31 | 31 | * @param string $version Version string. |
| 32 | 32 | * @return string |
| 33 | 33 | */ |
| 34 | -function desktop_mode_release_branch( $version ) { | |
| 34 | +function openstation_release_branch( $version ) { | |
| 35 | 35 | $p = explode( '.', (string) $version ); |
| 36 | 36 | return ( isset( $p[0] ) ? $p[0] : '0' ) . '.' . ( isset( $p[1] ) ? $p[1] : '0' ); |
| 37 | 37 | } |
| 38 | 38 | |
| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | * version (the dismissal key); `crossing` flags a new major. |
| 46 | 46 | * |
| 47 | 47 | * @return array{version:string,available:string,branch:string,url:string,crossing:bool}|null |
| 48 | 48 | */ |
| 49 | -function desktop_mode_get_core_update() { | |
| 49 | +function openstation_get_core_update() { | |
| 50 | 50 | if ( ! current_user_can( 'update_core' ) ) { |
| 51 | 51 | return null; |
| 52 | 52 | } |
| 53 | 53 | |
| @@ -73,14 +73,14 @@ | ||
| 73 | 73 | * to hide it. |
| 74 | 74 | * |
| 75 | 75 | * @param bool $show Default true. |
| 76 | 76 | */ |
| 77 | - if ( ! apply_filters( 'desktop_mode_show_core_update_notice', true ) ) { | |
| 77 | + if ( ! apply_filters( 'openstation_show_core_update_notice', true ) ) { | |
| 78 | 78 | return null; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $branch = desktop_mode_release_branch( $available ); | |
| 82 | - $crossing = desktop_mode_is_major_update( get_bloginfo( 'version' ), $available ); | |
| 81 | + $branch = openstation_release_branch( $available ); | |
| 82 | + $crossing = openstation_is_major_update( get_bloginfo( 'version' ), $available ); | |
| 83 | 83 | |
| 84 | 84 | return array( |
| 85 | 85 | 'version' => $crossing ? $branch : $available, |
| 86 | 86 | 'available' => $available, |