Open oandregal opened 1 day ago
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 props-bot
label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Size Change: +395 B (+0.02%)
Total Size: 1.82 MB
Filename | Size | Change |
---|---|---|
build/editor/index.min.js |
113 kB | +395 B (+0.35%) |
Part of https://github.com/WordPress/gutenberg/issues/61084
What?
This PR updates the
usePostFields
hook to take the fields from a central registry. It also implement the low-level APIs to allow register/unregister a field for any post type.This new API is only available in the Gutenberg plugin and it's private for now.
Why?
This follows suit of what we've done for actions. It is part of how we envision making the entities (dataviews) extensible, see https://github.com/WordPress/gutenberg/issues/61084
How?
wp.editor.registerEntityField
andwp.editor.unregisterEntityField
. 74436150810ae1d1adb73a41cd27780722d0aadcusePostFields
hook to take fields from the registry. 8649f93b3596c5efe49a5d41f375217d35e2ec28isReady
state to acomodateactions
and `fields. df078fd48f0290a66593d18ac2234b7ea320824aTesting Instructions
Go to the Pages page and verify that everything works as expected.
Test unregistering a field. After unregistering it, the field won't be available. In the Pages page, open the console and type:
https://github.com/user-attachments/assets/ece59037-d693-449f-a65a-6f5b6bcca582
https://github.com/user-attachments/assets/99ba9c9f-ddb2-4f7e-8839-c5f487e852b3