Skip to content

Commit 46f0221

Browse files
Only pass Apple OS shortcut label.
Co-Authored-By: westonruter <[email protected]>
1 parent ee48ad6 commit 46f0221

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/admin-bar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,16 +969,16 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
969969
* wp-i18n to be loaded as a dependency.
970970
*/
971971
$function = <<<'JS'
972-
( shortcutLabels ) => {
972+
( appleOSLabel ) => {
973973
if ( navigator.platform.startsWith("Mac") || navigator.platform === "iPhone" || navigator.platform === "iPad" ) {
974-
document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = shortcutLabels.appleOS;
974+
document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = appleOSLabel;
975975
}
976976
}
977977
JS;
978978
$script = sprintf(
979979
'( %s )( %s );',
980980
$function,
981-
wp_json_encode( $shortcut_labels, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
981+
wp_json_encode( $shortcut_labels['appleOS'], JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
982982
);
983983
$script .= "\n//# sourceURL=wp_admin_bar_command_palette_menu";
984984
$wp_admin_bar->add_node(

0 commit comments

Comments
 (0)