-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site Editor - prevent loading state from showing the admin menu. #36455
Site Editor - prevent loading state from showing the admin menu. #36455
Conversation
@@ -31,6 +31,15 @@ function gutenberg_is_edit_site_page( $page ) { | |||
return 'appearance_page_gutenberg-edit-site' === $page; | |||
} | |||
|
|||
// Default to is-fullscreen-mode to avoid rendering wp-admin navigation menu while loading and | |||
// having jumps in the UI. | |||
add_filter( |
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.
This is going to be executed for all pages, not just the site editor (because the php file is always loaded), should we instead move this into gutenberg_edit_site_init
?
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.
Ohh, that makes sense. I moved it into that function here c434238
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.
Do we need to also remove the filter as part of the ! gutenberg_is_edit_site_page( $hook )
conditional return?
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.
Also curious, does the function need to be static
here? I didn't think so, but then I noticed your example in wordpress-develop was also static but didn't seem to be part of a class?
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.
they started using "static" for closures like that recently something about PHP 8 support, but I didn't fully follow the explanations tbh :) So I might think it's better if it's static here as well.
It doesn't seem like we need to remove the filter though as it's only applied if we're on this page so, so it looks good to me.
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.
Changes look good. Thanks, @Addison-Stavlo.
Would we be able to get this into a point release for 11.9 if one ends up happening? cc @noisysocks |
@Addison-Stavlo I'm not sure if there are plans for a point release, but I've cherry picked this PR into the |
Thanks @andrewserong ! |
Description
Resolves #36445 by ensuring the site editor is in fullscreen mode while loading.
How has this been tested?
Load the site editor and verify you do not see the wp-admin menu while it loads, as is described in the linked issue.
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).