Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/compat/wordpress-5.9/move-theme-editor-menu-item.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Moves the theme editor menu items for FSE themes.
*
* @package gutenberg
*/

/**
* Moves the "theme editor" under "tools" in FSE themes.
*/
function gutenberg_move_theme_editor_in_block_themes() {
if ( ! gutenberg_is_fse_theme() || is_multisite() ) {
return;
}
remove_submenu_page( 'themes.php', 'theme-editor.php' );
add_submenu_page( 'tools.php', __( 'Theme Editor', 'default' ), __( 'Theme Editor', 'default' ), 'edit_themes', 'theme-editor.php' );
}

add_action( 'admin_menu', 'gutenberg_move_theme_editor_in_block_themes', 102 );
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/compat/wordpress-5.9/default-theme-supports.php';
require __DIR__ . '/compat/wordpress-5.9/class-gutenberg-rest-global-styles-controller.php';
require __DIR__ . '/compat/wordpress-5.9/rest-active-global-styles.php';
require __DIR__ . '/compat/wordpress-5.9/move-theme-editor-menu-item.php';

require __DIR__ . '/blocks.php';
require __DIR__ . '/block-patterns.php';
Expand Down