-
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
Optimize preload paths only for core/edit-post page #40587
Conversation
Is it something that should get included in WP 6.0? |
Yes, it would be nice to have there. |
ac1be53
to
1d4b8af
Compare
1d4b8af
to
c8bc405
Compare
Given that RC3 is scheduled for today, I am going to move this to the 6.0.1 Project Board. |
I just checked core patch for initial PR. There's a single change to the Side Editor preload paths and no changes for the Widgets Editor. So I don't think this needs backporting. |
function gutenberg_optimize_preload_paths( $preload_paths ) { | ||
function gutenberg_optimize_preload_paths( $preload_paths, $block_editor_context ) { | ||
// optimize only the post editor page, not site or widgets. | ||
if ( 'core/edit-post' !== $block_editor_context->name ) { |
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.
if ( 'core/edit-post' !== $block_editor_context->name ) { | |
if ( isset( $block_editor_context->name ) && 'core/edit-post' !== $block_editor_context->name ) { |
The name
property doesn't exist in WP >= 5.9, need to include a check to avoid PHP notice.
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.
isn't the min requirement 5.9 now?
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.
It's WP 6.0, so I don't think we need these changes anymore. See my previous comment - #40587 (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.
I left a small comment, but otherwise, this looks good to me 👍
I think we can close this PR. WP 6.0 compat is no longer required by the plugin. |
The current Gutenberg plugin requires WP6.3 or higher. Furthermore, there is no |
Follow-up to #39256 where I modify the
gutenberg_optimize_preload_paths
filter to patchpreload_paths
only for the Post Editor page (core/edit-post
). For any other page, like the Site or Widgets Editor, the filter now leaves thepreload_paths
intact.Fixes a bug that @fullofcaffeine and @david-binda discovered when deploying latest Gutenberg on WordPress.com.