Skip to content
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

Theme Export: Change the schema url #40106

Merged
merged 1 commit into from
Apr 6, 2022
Merged

Theme Export: Change the schema url #40106

merged 1 commit into from
Apr 6, 2022

Conversation

scruffian
Copy link
Contributor

@scruffian scruffian commented Apr 6, 2022

What?

This fixes a mistake from #39775. Rather than using a complicated split to work out the version number, we can just take the first three digits of the version number...

Testing Instructions

See #39775

@scruffian scruffian merged commit 3f0db22 into trunk Apr 6, 2022
@scruffian scruffian deleted the update/export-schema branch April 6, 2022 21:44
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Apr 6, 2022
@@ -104,11 +104,11 @@ function gutenberg_generate_block_templates_export_file() {
// If a version is defined, add a schema.
if ( $theme_json_raw['version'] ) {
global $wp_version;
$theme_json_version = substr( $wp_version, 0, strpos( $wp_version, '-' ) );
$theme_json_version = 'wp/' . substr( $wp_version, 0, 3 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when WordPress reaches version 10?

@scruffian: I spotted this today in Core while looking at other things. Can we fix this? Something like this is enough:

-		$theme_json_version = 'wp/' . substr( $wp_version, 0, 3 );
+		$theme_json_version = 'wp/' . substr( $version, 0, strpos( $version, '-' ) );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants