Repository navigation
Editor: Preload the entity fields and actions the editors read - #14516
jorgefilipecosta wants to merge 1 commit into
Conversation
The post editor now preloads the entity fields of the edited post type, which the post summary of its inspector reads, and the site editor preloads the entity actions of the edited post and of the post types its screen lists, as it already did for the entity fields.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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. |
Backports the preloads of WordPress/gutenberg#85081 (post editor entity fields) and WordPress/gutenberg#85155 (site editor entity actions).
The editors read the fields and actions of the post types they show from
/wp/v2/entity-fieldsand/wp/v2/entity-actions. Core preloads the fields in the site editor and the actions in the post editor, but not the other way around.This PR:
_wp_preload_entity_fields()also preload the fields of the edited post type in the post editor, which the post summary of its inspector reads since Editor: Stabilize the DataForm-based inspector gutenberg#85081._wp_preload_entity_actions()also preload, in the site editor, the actions of the edited post and of the post types its screen lists (pages, templates, patterns and template parts), reusing_wp_get_site_editor_screen_post_types().The new requests only happen once Core's Gutenberg pin includes the code that reads both routes. Until then the preloads go unused, as the existing ones do.
Testing Instructions
/wp/v2/entity-fields?kind=postType&name=pagerequest is made.wp-admin/site-editor.php?p=%2Fpageand verify no/wp/v2/entity-actions?kind=postType&name=pagerequest is made. Do the same on?p=%2Ftemplate(wp_template) and?p=%2Fpattern(wp_blockandwp_template_part).npm run test:php -- --group entity-fields,entity-actions.Trac ticket: https://core.trac.wordpress.org/ticket/66343
Use of AI Tools
AI assistance: Yes
Used for: writing the code and the tests, 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.