File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -951,20 +951,23 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
951951
952952 $ is_apple_os = (bool ) preg_match ( '/Macintosh|Mac OS X|Mac_PowerPC/i ' , $ _SERVER ['HTTP_USER_AGENT ' ] ?? '' );
953953 $ shortcut_label = $ is_apple_os
954- ? _x ( '⌘K ' , 'keyboard shortcut to open the command palette ' , ' gutenberg ' )
955- : _x ( 'Ctrl+K ' , 'keyboard shortcut to open the command palette ' , ' gutenberg ' );
954+ ? _x ( '⌘K ' , 'keyboard shortcut to open the command palette ' )
955+ : _x ( 'Ctrl+K ' , 'keyboard shortcut to open the command palette ' );
956956 $ title = sprintf (
957957 '<span class="ab-label"><kbd>%s</kbd><span class="screen-reader-text"> %s</span></span> ' ,
958958 $ shortcut_label ,
959959 /* translators: Hidden accessibility text. */
960- __ ( 'Open command palette ' , ' gutenberg ' ),
960+ __ ( 'Open command palette ' ),
961961 );
962962 $ wp_admin_bar ->add_node (
963963 array (
964964 'id ' => 'command-palette ' ,
965965 'title ' => $ title ,
966966 'href ' => '# ' ,
967- 'meta ' => array ( 'class ' => 'hide-if-no-js ' ),
967+ 'meta ' => array (
968+ 'class ' => 'hide-if-no-js ' ,
969+ 'onclick ' => 'if ( window.wp && wp.data && wp.data.dispatch ) { var store = wp.data.dispatch( "core/commands" ); if ( store && typeof store.open === "function" ) { store.open(); } } return false; ' ,
970+ ),
968971 )
969972 );
970973}
You can’t perform that action at this time.
0 commit comments