Skip to content

Commit 237d199

Browse files
committed
Explain why wp-i18n is not used.
1 parent 25015a6 commit 237d199

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/wp-includes/admin-bar.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,15 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
973973
)
974974
);
975975

976+
/*
977+
* The script is added as an inline script to avoid an additional dependency.
978+
*
979+
* Adding the code within the admin-bar script would require the wp-i18n script to be loaded
980+
* as a dependency. While this is widely available in the admin, the wp-i18n script is not
981+
* commonly required on the front end of the site. As the command palette is not available
982+
* on the front-end, the script would be loaded but remain unused on the front-end of
983+
* a website.
984+
*/
976985
$script = <<<JS
977986
(( shortCutLabels ) => {
978987
// Assigning agent may error if the HTTP header is blocked at the browser level.

0 commit comments

Comments
 (0)