-
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
Core Data: Check post-type support before requesting autosaves #68680
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. |
f1d7623
to
b4b176d
Compare
Size Change: +13 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
b4b176d
to
e71ea6a
Compare
Flaky tests detected in e71ea6a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12785860317
|
Based on discussion at WordPress/wordpress-develop#6035 we should also update this hardcoded check in gutenberg/packages/editor/src/store/selectors.js Lines 389 to 400 in 5a5455c
As well as in gutenberg/packages/editor/src/store/selectors.js Lines 612 to 617 in 5a5455c
|
Yes, I'm aware of those conditions. It needs to be handled separately after WordPress/wordpress-develop#7272 is merged. Both template and template parts support autosaves, but they are not working correctly. |
Looks like that one is ready to be committed, so I can do that. But I guess then we'll need to wait a bit until GB can use it? |
That or try to shim it the plugin. |
I think waiting is fine 👍 |
Thanks, @swissspidy! |
What?
PR updates the
getAutosaves
core data resolver to check if the post type supports autosaves before requesting data.Why?
Starting from WordPress 6.6, individual post-types can disable autosaves. The extra checks prevent unnecessary requests and 404 errors.
Testing Instructions
wp.data.select( 'core' ).getAutosave( 'page', pageId );
Testing Instructions for Keyboard
Same.
Screenshots or screencast