diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 47aa7742b9..cc18806d28 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -307,9 +307,17 @@ if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage $current_theme_actions = array(); if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { + $forbidden_paths = array( + 'themes.php', + 'theme-editor.php', + 'site-editor.php', + 'edit.php?post_type=wp_navigation', + ); + foreach ( (array) $submenu['themes.php'] as $item ) { $class = ''; - if ( 'themes.php' === $item[2] || 'theme-editor.php' === $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) { + + if ( in_array( $item[2], $forbidden_paths, true ) || str_starts_with( $item[2], 'customize.php' ) ) { continue; } // 0 = name, 1 = capability, 2 = file. @@ -541,7 +549,7 @@ foreach ( $themes as $theme ) : ?> @@ -553,7 +561,7 @@ foreach ( $themes as $theme ) : $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> - + @@ -913,7 +921,9 @@ function wp_theme_auto_update_setting_template() { $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> - + <# if ( ! data.blockTheme ) { #> + + <# } #> <# } #> <# } #> @@ -1121,7 +1131,9 @@ function wp_theme_auto_update_setting_template() { <# if ( data.actions.activate ) { #> <# } #> - + <# if ( ! data.blockTheme ) { #> + + <# } #> <# } else { #> <# } #> - + <# if ( ! data.blockTheme ) { #> + + <# } #> <# } #>