Repository navigation
Editor: Preload the entity fields of the post editor - #14517
Closed
jorgefilipecosta wants to merge 1 commit into
Closed
jorgefilipecosta wants to merge 1 commit into
jorgefilipecosta wants to merge 1 commit into
Conversation
The post summary of the post editor's inspector reads the fields of the edited post type from the `/wp/v2/entity-fields` route since Gutenberg stabilized the DataForm-based inspector, so the post editor now preloads them, as the site editor does. Follow-up to [64528]. See #66339.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Member
Author
|
Closing in favor of #14516, which includes the same change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the post editor part of
_gutenberg_preload_entity_fields()from WordPress/gutenberg#85081, a follow-up to the entity fields API that landed in r64528.Since that PR, the post summary of the post editor's inspector reads the fields of the edited post type from
/wp/v2/entity-fields. Gutenberg preloads them, but Core only preloads them in the site editor.This PR:
_wp_preload_entity_fields()also preload/wp/v2/entity-fields?kind=postType&name=<post type>in the post editor.test_the_post_editor_does_not_preload_the_fieldswith the Gutenberg testtest_the_post_editor_preloads_the_fields_of_the_post_type.The pinned Gutenberg build doesn't request the route yet, so this only takes effect with a pin that includes WordPress/gutenberg#85081. #14494 ports the other post editor preload paths of that PR, in
edit-form-blocks.php.Trac ticket: https://core.trac.wordpress.org/ticket/66339
Testing Instructions
npm run test:php -- --group entity-fields.gutenberg.shainpackage.jsontotrunk, then runnpm run gutenberg:downloadandnpm run build:dev./wp/v2/entity-fieldsrequest is made on load.Use of AI Tools
AI assistance: Yes
Used for: porting the change and the test from the Gutenberg PR, and drafting this description; reviewed and edited by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.