Skip to content

Commit 5a9dcbc

Browse files
committed
Command Palette: Add network admin check
To prevent the registration of commands that would cause a 404 error in the network admin screen, pass the result of the `is_network_admin()` check to the command palette initialization function. Follow-up to [61022]. Props jorbin, ntsekouras, soean, tobiasbg Fixes #64125. git-svn-id: https://develop.svn.wordpress.org/trunk@61121 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5b03f1f commit 5a9dcbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-includes/script-loader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3430,7 +3430,9 @@ function wp_enqueue_classic_theme_styles() {
34303430
function wp_enqueue_command_palette_assets() {
34313431
global $menu, $submenu;
34323432

3433-
$command_palette_settings = array();
3433+
$command_palette_settings = array(
3434+
'is_network_admin' => is_network_admin(),
3435+
);
34343436

34353437
if ( $menu ) {
34363438
$menu_commands = array();

0 commit comments

Comments
 (0)