Skip to content

Commit 7c4d406

Browse files
Apply suggestion from @westonruter
Co-authored-by: Weston Ruter <westonruter@gmail.com>
1 parent d4b0503 commit 7c4d406

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/wp-includes/admin-bar.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,9 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
971971
*/
972972
$function = <<<'JS'
973973
( shortcutLabels ) => {
974-
const isAppleOS = navigator.platform.startsWith("Mac") || navigator.platform === "iPhone" || navigator.platform === "iPad";
975-
if ( ! isAppleOS ) {
976-
return;
974+
if ( navigator.platform.startsWith("Mac") || navigator.platform === "iPhone" || navigator.platform === "iPad" ) {
975+
document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = shortcutLabels.appleOS;
977976
}
978-
document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = shortcutLabels.appleOS;
979977
}
980978
JS;
981979
$script = sprintf( '( %s )( %s );', $function, wp_json_encode( $shortcut_labels, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );

0 commit comments

Comments
 (0)