Changeset 52406 for trunk/src/wp-admin/menu.php
- Timestamp:
- 12/21/2021 08:04:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/menu.php
r52330 r52406 242 242 unset( $appearance_cap ); 243 243 244 // Add 'Theme Editor' to the bottom of the Appearancemenu.244 // Add 'Theme File Editor' to the bottom of the Appearance (non-block themes) or Tools (block themes) menu. 245 245 if ( ! is_multisite() ) { 246 246 // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook. … … 248 248 } 249 249 /** 250 * Adds the 'Theme Editor' link to the bottom of the Appearance or Tools menu. 250 * Adds the 'Theme File Editor' menu item to the bottom of the Appearance (non-block themes) 251 * or Tools (block themes) menu. 251 252 * 252 253 * @access private 253 254 * @since 3.0.0 254 * @since 5.9.0 'Theme Editor' link has moved to the Tools menu when a block theme is active. 255 * @since 5.9.0 Renamed 'Theme Editor' to 'Theme File Editor'. 256 * Relocates to Tools for block themes. 255 257 */ 256 258 function _add_themes_utility_last() { 257 259 add_submenu_page( 258 260 wp_is_block_theme() ? 'tools.php' : 'themes.php', 259 __( 'Theme Editor' ),260 __( 'Theme Editor' ),261 __( 'Theme File Editor' ), 262 __( 'Theme File Editor' ), 261 263 'edit_themes', 262 264 'theme-editor.php' 265 ); 266 } 267 268 /** 269 * Adds the 'Plugin File Editor' menu item after the 'Themes File Editor' in Tools 270 * for block themes. 271 * 272 * @access private 273 * @since 5.9.0 274 */ 275 function _add_plugin_file_editor_to_tools() { 276 if ( ! wp_is_block_theme() ) { 277 return; 278 } 279 add_submenu_page( 280 'tools.php', 281 __( 'Plugin File Editor' ), 282 __( 'Plugin File Editor' ), 283 'edit_plugins', 284 'plugin-editor.php' 263 285 ); 264 286 } … … 284 306 /* translators: Add new plugin. */ 285 307 $submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' ); 286 $submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' ); 308 if ( wp_is_block_theme() ) { 309 // Place the menu item below the Theme File Editor menu item. 310 add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 ); 311 } else { 312 $submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); 313 } 287 314 } 288 315
Note: See TracChangeset
for help on using the changeset viewer.