Skip to content

Commit

Permalink
Move the theme editor under tools for FSE themes (#36723)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and noisysocks committed Nov 23, 2021
1 parent c6c1438 commit 7c19bb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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 @@ -121,6 +121,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

0 comments on commit 7c19bb9

Please sign in to comment.