We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TypeError
1 parent c301ceb commit c39fb03Copy full SHA for c39fb03
1 file changed
src/wp-includes/admin-bar.php
@@ -971,8 +971,12 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
971
*/
972
$function = <<<'JS'
973
( applePattern, appleOSLabel ) => {
974
- if ( ( new RegExp( applePattern, 'i' ) ).test( navigator.userAgent ) ) {
975
- document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = appleOSLabel;
+ if ( ! ( new RegExp( applePattern, 'i' ) ).test( navigator.userAgent ) ) {
+ return;
976
+ }
977
+ const kbd = document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' );
978
+ if ( kbd ) {
979
+ kbd.textContent = appleOSLabel;
980
}
981
982
JS;
0 commit comments