-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Command Palette: Disable site editor navigation commands on Network Admin #72572
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
Conversation
|
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. |
|
Size Change: +52 B (0%) Total Size: 2.21 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 16219c8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18714565599
|
ntsekouras
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and LGTM, thanks! I also searched if /wp-admin/network could be configurable and it seems it's not.
|
@ntsekouras Thanks for the review! |
…dmin (#72572) Co-authored-by: t-hamano <[email protected]> Co-authored-by: ntsekouras <[email protected]>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: 6af5ed7 |
|
It only works if the pathname starts with We have many multisites where WordPress is in a folder, so we have the pathname |
|
@Soean Thanks for the feedback!
This is an extreme example, but I realized that it's also possible that the folder itself contains the string In this case, the site editor navigation commands should not be disabled, but I don't know how to accurately determine whether it's a multisite or not using JavaScript 🤔 |
|
Yes, this will not work reliably. I also have a multisite with subfolders. |
|
@TobiasBg Thanks for the feedback! Yes, it would be better to perform the checks accurately on the server side. I will submit a follow-up PR later. |
…dmin (WordPress#72572) Co-authored-by: t-hamano <[email protected]> Co-authored-by: ntsekouras <[email protected]>
What? Why?
The Site Editor is not available in the Multisite Network Admin screen and must be disabled.
How?
Check if
window.location.pathnameincludes/wp-admin/network.Another approach might be to check for
is+network_admin()on the server side and pass the result to theinitializeCommandPalettefunction.Testing Instructions
Make the following changes to
.wp-env.jsonand runnpm run start.Go to: Stylesare displayed.