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

Custom Templates: Use "title" from the theme.json #35592

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

Mamaduka
Copy link
Member

Description

Updates _gutenberg_get_template_files method to merge customTemplates definition from the "theme.json."

PR introduces new _gutenberg_add_template_info helper method.

Fixes #32818.

How has this been tested?

  1. Install and Activate TT1 Blocks.
  2. Create a page.
  3. Templates dropdown should display a title - "Page without title" instead of a "slug."

Screenshots

Before After
CleanShot 2021-10-13 at 16 14 22 CleanShot 2021-10-13 at 16 15 00

Types of changes

Bugfix

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 Oct 13, 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] Bug An existing feature does not function as intended labels Oct 13, 2021
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Works well 👍

@Mamaduka
Copy link
Member Author

Thanks for the review, @youknowriad.

@Mamaduka Mamaduka merged commit ec67990 into trunk Oct 18, 2021
@Mamaduka Mamaduka deleted the fix/custom-templates-details branch October 18, 2021 11:12
@github-actions github-actions bot added this to the Gutenberg 11.8 milestone Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Templates: Should use "title" instead of "name" when displayed to the user
2 participants