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
Documentation: Adds clarifications and clears up inaccuracies #46283
Documentation: Adds clarifications and clears up inaccuracies #46283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburridge Thanks for the PR. One edit.
@@ -29,15 +29,15 @@ registerBlockType( metadata.name, { | |||
} ); | |||
``` | |||
|
|||
The first parameter in the **registerBlockType** function is the block name, this should match exactly to the name registered in the PHP file. | |||
The first parameter in the **registerBlockType** function is the block name, this should match exactly to the `name` property in the `block.json` file. By importing the metadata from `block.json` and referencing the `name` property in the first parameter we ensure that they will match, and continue to match even if the name is subsecquently changed in `block.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first parameter in the **registerBlockType** function is the block name, this should match exactly to the `name` property in the `block.json` file. By importing the metadata from `block.json` and referencing the `name` property in the first parameter we ensure that they will match, and continue to match even if the name is subsecquently changed in `block.json`. | |
The first parameter in the **registerBlockType** function is the block name, this should match exactly to the `name` property in the `block.json` file. By importing the metadata from `block.json` and referencing the `name` property in the first parameter we ensure that they will match, and continue to match even if the name is subsequently changed in `block.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks @alexstine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together @mburridge. I made one small change to add a comma, but otherwise LGTM!
Co-authored-by: Ryan Welcher <me@ryanwelcher.com>
This one good to go now? If so, feel free to re-run the pesky failing tests and merge. Flaky tests. |
What?
Fixes inaccurate reference to the name being registered in the PHP file and corrects it to reference the
name
property in theme.json.Fixes inaccurate implication that
setAttributes
gets passed to thesave
function.Adds some clarifications around both items.
Why?
To remove inaccurate/misleading information and provide clarification.