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

Update @wordpress packages #1928

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Changes from lib/compat/wordpress-5.9/move-theme-editor-menu-item.php
  • Loading branch information
noisysocks committed Nov 23, 2021
commit 1cd6365f11cf4fe1e8cc56b6b4007abf611ad265
13 changes: 10 additions & 3 deletions src/wp-admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,24 @@

// Add 'Theme Editor' to the bottom of the Appearance menu.
if ( ! is_multisite() ) {
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
add_action( 'admin_menu', '_add_themes_utility_last', 101 );
}
/**
* Adds the 'Theme Editor' link to the bottom of the Appearance menu.
* Adds the 'Theme Editor' link to the bottom of the Appearance or Tools menu.
*
* @access private
* @since 3.0.0
* @since 5.9.0 'Theme Editor' link has moved to the Tools menu when a block theme is active.
*/
function _add_themes_utility_last() {
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
add_submenu_page( 'themes.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
add_submenu_page(
wp_is_block_template_theme() ? 'tools.php' : 'themes.php',
__( 'Theme Editor' ),
__( 'Theme Editor' ),
'edit_themes',
'theme-editor.php'
);
}

$count = '';
Expand Down