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

Site Editor Templates: Titles and descriptions should remain as static strings even when edited #69261

Open
3 of 6 tasks
mrfoxtalbot opened this issue Feb 20, 2025 · 1 comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Templates API Related to API powering block template functionality in the Site Editor Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Comments

@mrfoxtalbot
Copy link

mrfoxtalbot commented Feb 20, 2025

Description

By default, a template's title and description are static strings. However, when a template is edited, the default title and description strings will be stored in the database for that template, replacing the static ones. This creates several issues:

  1. If a template description is edited, future (core or translation) updates to that template's description will not be applied, it will use the ones stored in the DB when the template was edited.
  2. If a site has several users who use different languages and they all work on the site editor, each template's title/description will be changed to match the user language. See Site Editor Templates: Translations strings ignore user settings #55699
  3. If a template is edited while the site is set to language A, and then the site's language is changed to B, the title and description of any edited templates will show in language A, not B. The result is mixed languages. Below is an example of a site in Spanish that shows the title and description in English.

Image

The title/description of a template should be determined based on the template type and taken from the get_default_block_template_types function output. This is tied to the way register_block_template and related functions work.

Relevant links

This gap seems to be have been reported in the past:

Related PR:

Relevant discussion:

Step-by-step reproduction instructions

  1. Spin a new site in English
  2. Make any edits to a template and save it.
  3. Got to /wp-admin/options-general.php and set the site to Spanish
  4. Go back to the template you just edited
  5. Notice how the interface is in Spanish except for the template's site and title, which are in English.

Environment info

  • WP 6.7.1
  • No Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@mrfoxtalbot mrfoxtalbot added the [Type] Bug An existing feature does not function as intended label Feb 20, 2025
@mrfoxtalbot mrfoxtalbot added Internationalization (i18n) Issues or PRs related to internationalization efforts [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Feb 20, 2025
@mrfoxtalbot mrfoxtalbot changed the title Site EditorTemplates: Titles and descriptions Should remain as static strings even when edited Site Editor Templates: Titles and descriptions Should remain as static strings even when edited Feb 20, 2025
@mrfoxtalbot mrfoxtalbot changed the title Site Editor Templates: Titles and descriptions Should remain as static strings even when edited Site Editor Templates: Titles and descriptions should remain as static strings even when edited Feb 20, 2025
@t-hamano t-hamano added the [Feature] Templates API Related to API powering block template functionality in the Site Editor label Feb 20, 2025
@nani-samireddy
Copy link

nani-samireddy commented Feb 21, 2025

@mrfoxtalbot i'm able to replicate the issue
As you mentioned once I edit any template and save it. It is getting the details from the DB. I think once we edit any template it stores them in the DB making them as custom templates(Customised Template).

I'm also looking into the issue and checking if I can get any solution/fix

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] Templates API Related to API powering block template functionality in the Site Editor Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants