-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Create Block: Simplify blocks-manifest registration #74647
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
Create Block: Simplify blocks-manifest registration #74647
Conversation
Simplify's the code generated to register blocks in the main plugin file to default to using the new wp_register_block_types_from_metadata_collection function. Leaves the links to the update posts in the comments, so that developers building blocks for older WordPress versions can make the nessecary changes manually.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
jorgefilipecosta
left a comment
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 change looks good given that now we are requring at least WordPress 6.8 and we know wp_register_block_types_from_metadata_collection is available there.
jorgefilipecosta
left a comment
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 change looks good given that now we are requring at least WordPress 6.8 and we know wp_register_block_types_from_metadata_collection is available there.
t-hamano
left a comment
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.
@jonathanbossenger Can you update the document as well?
| - `requiresAtLeast` (default: `'6.7'`) – the lowest WordPress version that the plugin will work on. |
We may need to update testedUpTo as well.
| testedUpTo: '6.7', |
| - `testedUpTo` (default: `'6.7'`) – the highest WordPress version that the plugin has been tested against. |
Reproduction ReportThis report validates that the PR works as expected Environment
Steps to Reproduce
You should get some errors indicating the WP version doesn't match the minimum version required by the plugin Expected Results
function create_block_example_static_block_init() {
wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
}
add_action( 'init', 'create_block_example_static_block_init' );Actual Results
|
@t-hamano will do 🫡 |
|
@t-hamano all instances of |
t-hamano
left a comment
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.
LGTM!
* Simplify blocks-manifest registration Simplify's the code generated to register blocks in the main plugin file to default to using the new wp_register_block_types_from_metadata_collection function. Leaves the links to the update posts in the comments, so that developers building blocks for older WordPress versions can make the nessecary changes manually. * Update WordPress versions Co-authored-by: jonathanbossenger <psykro@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: juanmaguitar <juanmaguitar@git.wordpress.org>
What?
Closes #74645
Why?
Simplifies the code generated to register blocks in the main plugin file to default to using the new wp_register_block_types_from_metadata_collection function.
Leaves the links to the update posts in the comments, so that developers building blocks for older WordPress versions can make the necessary changes manually.
How?
Testing Instructions