-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor: Shim meta attributes for early block registrations #20544
Conversation
Size Change: +34 B (0%) Total Size: 866 kB
ℹ️ View Unchanged
|
0ee9496
to
6ca77f4
Compare
So, is |
@mrleemon: There is a dev note in the works (edit: published here) which will be published in the next days (see their drafting). The quick answer is that you can now use: const [ meta, setMeta ] = useEntityProp( 'postType', 'post', 'meta' ); Although, to be clear, the shim in question in this PR is there so that nothing breaks overnight. It just means that |
* Editor: Shim meta attributes for early block registrations * E2E Tests: Add meta block early registration test * Editor: Clarify comment regarding meta attribute shim
* Editor: Shim meta attributes for early block registrations * E2E Tests: Add meta block early registration test * Editor: Clarify comment regarding meta attribute shim
Fixes #20494
This pull request seeks to resolve an issue where blocks which are registered early and use the (now-deprecated) meta attribute source would fail to apply the compatibility shims introduced between #17153 and #20494.
Testing Instructions:
There are two ways to test:
Per #20494, following the meta block tutorial should yield a plugin with code such as in the following gist:
https://gist.github.com/aduth/9953fdd7676ce080ab24c2c8a85ae783
From the page, you may be able to to download a ZIP to use as plugin.
Otherwise, you can use the now-updated "Meta Attribute Block" Gutenberg test plugin to verify the behavior. You can do this as a user if you are using the default development environment by activating the plugin from the Plugins screen.
You can ensure the end-to-end tests pass: