Repository navigation
Update the registration examples to use apiVersion 2 - #26100
Merged
Merged
Conversation
youknowriad
requested review from
ajitbohra,
chrisvanpatten,
ellatrix and
mkaz
as code owners
October 14, 2020 10:45
|
Size Change: -618 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
6 tasks done
ellatrix
reviewed
Oct 15, 2020
| return <RichText.Content tagName="h2" value={ attributes.content } />; // Saves <h2>Content added in the editor...</h2> to the database for frontend display | ||
| const blockProps = useBlockProps.save(); | ||
|
|
||
| return <RichText.Content { ...blockProps } tagName="h2" value={ attributes.content } />; // Saves <h2>Content added in the editor...</h2> to the database for frontend display |
Member
There was a problem hiding this comment.
Alternatively this could be <h2 {...blockProps}><RichText.Content value="" /></h2>, but I don't mind either way.
ellatrix
reviewed
Oct 15, 2020
Co-authored-by: Ella van Durpe <wp@iseulde.com>
ellatrix
reviewed
Oct 15, 2020
| var el = element.createElement, | ||
| registerBlockType = blocks.registerBlockType, | ||
| withSelect = data.withSelect; | ||
| withSelect = data.withSelect, |
Member
There was a problem hiding this comment.
Should we update to useSelect too? Or maybe a separate PR.
ellatrix
approved these changes
Oct 15, 2020
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.
This PR updates the block examples in our docs to use apiVersion: 2.
In addition to this PR, we'd need a few things:
useBlockPropsI think we should create PRs for this and merge them together once we get close to the WordPress 5.6 release (to avoid confusing the developpers).