Skip to content

Commit

Permalink
Admin: Prevent easy access to the Site Editor
Browse files Browse the repository at this point in the history
Fixes #390
  • Loading branch information
ryelle committed Apr 1, 2024
1 parent b28d089 commit 7281359
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions source/wp-content/themes/wporg-main-2022/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,23 @@ function update_header_template_part_class( $block ) {
}
return $block;
}

/**
* Prevent easy access to the Site Editor.
*
* See https://github.com/WordPress/wporg-main-2022/issues/390.
*/
add_action(
'admin_menu',
function() {
remove_submenu_page( 'themes.php', 'site-editor.php' );
}
);

add_action(
'admin_bar_menu',
function ( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'site-editor' );
},
499 // Before the wporg-mu-plugins action.
);

0 comments on commit 7281359

Please sign in to comment.