PluginProbe
Gutenberg / 12.6.0
Gutenberg v12.6.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / compat / wordpress-5.9 / move-theme-editor-menu-item.php

move-theme-editor-menu-item.php in Gutenberg 12.6.0, at lib/compat/wordpress-5.9/move-theme-editor-menu-item.php

25 lines 755 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Moves the theme editor menu items for FSE themes.
4 *
5 * @package gutenberg
6 */
7
8 /*
9 * If wp_list_users is defined, it means the plugin
10 * is running on WordPress 5.9, so no need to change menu location.
11 */
12 if ( ! function_exists( 'wp_list_users' ) ) {
13 /**
14 * Moves the "theme editor" under "tools" in block themes.
15 */
16 function gutenberg_move_theme_editor_in_block_themes() {
17 if ( ! wp_is_block_theme() || is_multisite() ) {
18 return;
19 }
20 remove_submenu_page( 'themes.php', 'theme-editor.php' );
21 add_submenu_page( 'tools.php', __( 'Theme File Editor', 'gutenberg' ), __( 'Theme File Editor', 'gutenberg' ), 'edit_themes', 'theme-editor.php' );
22 }
23 add_action( 'admin_menu', 'gutenberg_move_theme_editor_in_block_themes', 102 );
24 }
25