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

Can't change the slug of a wp_template #28847

Closed
aristath opened this issue Feb 8, 2021 · 2 comments
Closed

Can't change the slug of a wp_template #28847

aristath opened this issue Feb 8, 2021 · 2 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@aristath
Copy link
Member

aristath commented Feb 8, 2021

Description

Trying to create a template for a page with id=2 in an FSE theme I found it impossible to set the slug of the template to page-2so it only gets applied to a specific page.

Step-by-step reproduction instructions

  1. From the dashboard go to Appearance > Templates
  2. Create a new template. Add a title and save it. The slug is saved as custom_slug_602145e030737, containing a unique ID instead of the title slug-ified.
  3. Refresh the page, and from the sidebar change the slug to page-2
  4. After refreshing the page you will see the slug wasn't changed, and as a result the template does not get applied to the corresponding page.

If I go in the database and manually change the slug of the post there, the template gets properly applied to the page on the frontend.

Expected behaviour

  • On initial save, the slug should be built from the title instead of getting a slug custom_slug_*.
  • If the user changes the slug from the slug field, the changes should be saved.

WordPress information

  • WordPress version: 5.7-beta1
  • Gutenberg version: 9.9.1
  • Are all plugins except Gutenberg deactivated? Yes
@mtias
Copy link
Member

mtias commented May 22, 2022

@aristath are you still experiencing this issue?

@aristath
Copy link
Member Author

This is no longer replicable.
We have removed the "Templates" menu under Appearance, and when trying to create a new template from the site-editor, we now have a limited selection of templates that can be created.
So it's still not possible to create a template for a specific page (a page-2.html template) from the site-editor, but for different reasons.
I'll go ahead and close this one since it's no longer relevant, a lot of things have changed since this issue was created 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants