-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix (performance): improvements based on code profiler part 2 #3178
Conversation
…ional checks to the top
…tring exists first before replacing
🤖 Pull request artifacts
|
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.
Comments:
- Please also commit the built file
src/stk-block-types.php
so the plugin would work even by just doing a checkout
src/blocks.php
Outdated
$block_type = new WP_Block_Type( $metadata['name'], $block_args ); | ||
register_block_type( $block_type ); |
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.
Any reason why we can't just register the block right away?
register_block_type( $metadata['name'], $block_args );
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.
based on this documentation , register_block_type
accepts a string or an instance of WP_Block_Type
for the first argument, if it's a string it will consider it as a path to the block.json
and will try to use register_block_type_from_metadata()
instead.
fixes #3172