-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Classic themes: prevent access to parts of the Site Editor #69473
Conversation
Size Change: +163 B (+0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
e60970e
to
6550696
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated by @t-hamano: Add the props in #69005 here. When merging this PR, don't forget to add the following props:
|
Hi http://localhost:8888/wp-admin/site-editor.php http://localhost:8888/wp-admin/site-editor.php?p=/wp_navigation/1&canvas=edit -This does not show a notice unless I make the screen width narrow. http://localhost:8888/wp-admin/site-editor.php?p=/wp_template/twentytwentyfive//archive&canvas=edit -this does not show a notice when the screen width is narrow. |
Sorry, this was my mistake. This PR does not change anything regarding the home route.
Fixed: c5bab3c |
The messages are showing now, thank you. |
Let's merge #69377 first and then rebase on top of it. We should also confirm that failing CI checks aren't related. |
It looks like we need to fix the failure from the @ockham, can you confirm that this was an oversight on our end? Or does the test require running the TT1 default e2e test theme? Screeenshot |
Yes, I just noticed that too. For now, I activated Emptytheme for "Block Hooks in Navigation Menu" testing, and it seems to work fine locally. What do you think? |
Yes, that seems like a correct solution to me 👍 |
It doesn't require it. I was hoping to run the test with a Classic Theme (and was unaware that being able to access the Site Editor for Navigation menus while using a Classic Theme was a bug 😅), but it should be fine to switch to a Block Theme 👍 |
Those were restrictions through obscurity, which we're finally fixing 😄 Thanks for the confirmation, @ockham! |
Thank you everyone! I will merge this PR. |
* Classic themes: prevent access to parts of the Site Editor * Fix black screen * e2e: Activate block theme for "Block Hooks in Navigation Menu" tests Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>
I just cherry-picked this PR to the wp/6.8 branch to get it included in the next release: 828a6ad |
What?
Closes #68950
Alternatives to #69005
On screens that are not expected to be accessed from the classic theme, hide all UI and just show a warning message.
Why?
The site editor is currently not intended to be used from classic themes, except for StyleBook and Patterns.
Previously there was a process on the server side to prevent access, but this is no longer the case, so it must be handled on the client side.
How?
Uses the data for the root area resolver implemented by #69299 and returns a warning message or undefined for the classic theme.
Below is a list of routes that are prohibited by this PR:
Top: http://localhost:8888/wp-admin/site-editor.phpTesting Instructions
It's a good idea to test this by opening multiple tabs:
Screenshots or screencast
When the canvas mode is "view"
When the canvas mode is "edit"