Skip to content

Commit 1f988f8

Browse files
committed
Simplify onClick event process
1 parent dbd527f commit 1f988f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/admin-bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
966966
'href' => '#',
967967
'meta' => array(
968968
'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;',
969+
'onclick' => 'wp.data.dispatch( "core/commands" ).open(); return false;',
970970
),
971971
)
972972
);

0 commit comments

Comments
 (0)