Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the theme editor under tools for FSE themes #36723

Merged
merged 1 commit into from
Nov 22, 2021
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 );
ntsekouras marked this conversation as resolved.
Show resolved Hide resolved
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