-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 block editor stylesheet being registered with wrong URL #4679
Fix block editor stylesheet being registered with wrong URL #4679
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.
One nitpick, but looks good to me.
Co-authored-by: Joe McGill <801097+joemcgill@users.noreply.github.com>
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 @felixarntz for the PR. Just a couple driveby nits.
$metadata_file = ABSPATH . $block_json_path; | ||
$metadata = wp_json_file_decode( $metadata_file, array( 'associative' => true ) ); |
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.
instead of loading the metadata like this, by not use the parsed php?
$metadata_file = ABSPATH . $block_json_path; | |
$metadata = wp_json_file_decode( $metadata_file, array( 'associative' => true ) ); | |
$core_blocks_meta = require ABSPATH . WPINC . '/blocks/blocks-json.php'; | |
$metadata = $core_blocks_meta[$block_name]; |
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.
I think for tests that doesn't really matter. The block.json
file is the source of truth while blocks-json.php
is a built file, so I think for tests relying on block.json
is a more reliable approach.
Committed in https://core.trac.wordpress.org/changeset/56005. |
Trac ticket: https://core.trac.wordpress.org/ticket/58605
This PR also includes test coverage for the core-specific code paths of
register_block_style_handle()
which was missing before.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.