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. |
The editors read the fields and actions of the post types they show from the `wp/v2/entity-fields` and `wp/v2/entity-actions` routes. Core preloaded the fields only in the site editor and the actions only in the post editor. The post editor now also preloads the entity fields of the edited post type, which the post summary of its inspector reads. The site editor now also preloads the entity actions of the edited post and of the post types its screen lists (pages, templates, patterns and template parts), as it already did for the entity fields. Developed in #14516. Synced from WordPress/gutenberg#85081 and WordPress/gutenberg#85155. Follow-up to [64528], [64566]. Props jorgefilipecosta, oandregal. See #66343. git-svn-id: https://develop.svn.wordpress.org/trunk@64595 602fd350-edb4-49c9-b593-d223f7449a82
The editors read the fields and actions of the post types they show from the `wp/v2/entity-fields` and `wp/v2/entity-actions` routes. Core preloaded the fields only in the site editor and the actions only in the post editor. The post editor now also preloads the entity fields of the edited post type, which the post summary of its inspector reads. The site editor now also preloads the entity actions of the edited post and of the post types its screen lists (pages, templates, patterns and template parts), as it already did for the entity fields. Developed in WordPress/wordpress-develop#14516. Synced from WordPress/gutenberg#85081 and WordPress/gutenberg#85155. Follow-up to [64528], [64566]. Props jorgefilipecosta, oandregal. See #66343. Built from https://develop.svn.wordpress.org/trunk@64595 git-svn-id: http://core.svn.wordpress.org/trunk@63745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.