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

Create single template via site editor if not existing #40830

Merged

Conversation

luminuu
Copy link
Member

@luminuu luminuu commented May 4, 2022

What?

This PR changes the slug of the single template from single-post to single, which is the default slug for the single (post) template.

Why?

This PR fixes the issue #40814, where it was discovered that the template for single is not createable from the site editor when this template is not yet existing.

How?

Previously the single template was addressed as single-post, but this is not existing in the template hierarchy as default single template. The post suffix has been removed from all occurences.

Testing Instructions

  1. Have an environment with WP 6.0 RC 1 available.
  2. Activate a block theme with no single template available, for example Miniblock OOAK.
  3. Go to the site editor.
  4. Open the templates overview.
  5. Click on the "Add" button and see the single template in the list of available default templates.

Screenshots or screencast

@github-actions
Copy link

github-actions bot commented May 4, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @luminuu! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 4, 2022
@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Template Editing Mode Related to the template editor available in the Block Editor labels May 4, 2022
@Mamaduka Mamaduka requested a review from scruffian May 5, 2022 05:27
Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this. LGTM

@priethor priethor added the [Type] Bug An existing feature does not function as intended label May 5, 2022
@priethor priethor linked an issue May 5, 2022 that may be closed by this pull request
@carolinan
Copy link
Contributor

Creating the new template works well. But are there any other potential issues we should test for with the rename? Any compatibility issues for existing themes and plugins?

@luminuu
Copy link
Member Author

luminuu commented May 6, 2022

Creating the new template works well. But are there any other potential issues we should test for with the rename? Any compatibility issues for existing themes and plugins?

I've searched the entire repository for single-post and except for one entry in the changelog I edited all occurences - which were only the three files in the commit. I don't think existing themes will have an issue with this, if there is a single.html template file existing, you're not going to see the entry at the Add button.

@Mamaduka Mamaduka merged commit 7a347c0 into WordPress:trunk May 12, 2022
@github-actions github-actions bot added this to the Gutenberg 13.3 milestone May 12, 2022
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] Template Editing Mode Related to the template editor available in the Block Editor First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not possible to create single/singular template in site editor
6 participants