Skip to content

Add $schema and use Gutenberg classes #99

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

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

scruffian
Copy link
Contributor

This adds the $schema key when overwriting and exporting themes. It also uses the WP_Theme_JSON_Gutenberg class if it's available, so that the latest features of the plugin are included.

To test, try exporting/overwriting a block theme and check that the $schema key still exists. Also check that button elements aren't wiped. You can see an example here: Automattic/themes#5708

Fixes #81

@scruffian scruffian self-assigned this Aug 5, 2022
@scruffian scruffian requested a review from pbking August 5, 2022 14:43
@MaggieCabrera
Copy link
Contributor

MaggieCabrera commented Aug 5, 2022

This works as expected in every case except when trying to create a child theme. It generates a zip that won't open (it works on trunk, but fails on this branch)

I'm seeing this:

Screenshot 2022-08-05 at 16 56 53

@scruffian
Copy link
Contributor Author

Thanks @MaggieCabrera, I added a commit to fix that...

Copy link
Contributor

@MaggieCabrera MaggieCabrera left a comment

Choose a reason for hiding this comment

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

Lovely, it works as intended! Thank you for this

@scruffian scruffian merged commit d753f65 into trunk Aug 8, 2022
@scruffian scruffian deleted the update/add-schema-and-use-gutenberg-classes branch August 8, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the $schema key to theme.json
2 participants