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

FSE: Add basic support for child themes #34354

Merged
merged 1 commit into from
Sep 22, 2021
Merged

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Aug 27, 2021

Description

Part of #25612.
Fixes #33959.
Fixes #33957.

Adds basic support for child themes in Full Site Editor/Global Styles.

Features covered

  • Block template and template parts file inheritance.
  • The theme.json inheritance.

Props

This is based on previous work by @aristath and @oandregal.

P.S. I'm not sure how we want to handle user-created templates and wasn't able to find any information. I would be happy to iterate on this PR or create a follow-up if anyone can point me in the right direction.

How has this been tested?

  1. Create TT1 Blocks child theme.
wp scaffold child-theme tt1-blocks-child --parent_theme=tt1-blocks --theme_name="TT1 Blocks Child"
  1. Activate the child theme.
  2. See that the "Site Editor" admin menu is visible.
  3. Check that you can edit template files.
  4. See that template and template parts are correctly rendered on the front-end.

Types of changes

Enhancement

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@Mamaduka Mamaduka self-assigned this Aug 27, 2021
@Mamaduka Mamaduka added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement. labels Aug 27, 2021
@Mamaduka Mamaduka added [Feature] Full Site Editing and removed [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Aug 31, 2021
@carolinan
Copy link
Contributor

carolinan commented Sep 14, 2021

Test result:

  • The site editor is available when the child theme is active

  • Templates and template parts are working correctly on the front and in the editors

  • Theme.json is inherited

  • Parent theme template parts can be overridden in the child theme

  • Parent theme templates can be overridden in the child theme

  • Theme.json can be overridden in the child theme

@Mamaduka
Copy link
Member Author

Thanks for the review, @carolinan ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
2 participants