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

feat: remove Full Site Editor from menu bar #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brunodeangelis
Copy link
Contributor

@brunodeangelis brunodeangelis commented Dec 2, 2022

This PR adds an option to disable the menu item Appearance -> Editor (beta)

image

There is a plugin that does this better, but the code is not as straightforward as I would've liked to port it here, so this is only what I managed to do.

This code has no redirection from wp-admin/site-editor.php to admin_url() because I couldn't get the usual snippet to work:

add_action( 'template_redirect', function () {
	global $pagenow;

	if ( $pagenow === 'site-editor.php' ) {
		wp_redirect( admin_url() );
		exit;
	}
} );

Any ideas are welcomed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant