Skip to content

Editor: Add an extra check before enabling the new default rendering mode for Pages #69209

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

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Feb 16, 2025

What?

This is a small follow-up to #69160.

PR hardens condition before enabling template-locked as default rendering mode for Pages.

Why?

While it should be an edge case for a block theme not to support block-templates, it's still technically doable. See: #67875 (comment).

Testing Instructions

  1. Open a page.
  2. Confirm that it loads with a template-locked view.
  3. Doesn't change the current behavior.
  4. Remove block-templates theme support.
  5. Reload the page.
  6. Confirm that it loads in post-only mode.

Testing Instructions for Keyboard

Same.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Package] Editor /packages/editor labels Feb 16, 2025
@Mamaduka Mamaduka self-assigned this Feb 16, 2025
Copy link

github-actions bot commented Feb 16, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

though really I would expect that then support to be a check that happens inside the is_block_theme function because what is a blink theme if not block templates?

@Mamaduka
Copy link
Member Author

@fabiankaegy, I think the current behavior is for legacy reasons. WP shipped block-templates before Site Editor and block themes, which started using the existing system by enabling block templates (see wp_enable_block_templates).

The wp_is_block_theme can also be called before any theme support flags are setup since it only checks the existence of files in themes.

@Mamaduka Mamaduka merged commit 590af0a into trunk Feb 17, 2025
64 checks passed
@Mamaduka Mamaduka deleted the fix/editor-default-rendering-mode-condition branch February 17, 2025 05:49
@github-actions github-actions bot added this to the Gutenberg 20.4 milestone Feb 17, 2025
Kallyan01 pushed a commit to Kallyan01/gutenberg that referenced this pull request Feb 24, 2025
…mode for Pages (WordPress#69209)

* Editor: Add an extra check before enabling the new default rendering mode for Pages
* Add backport changelog entry

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…mode for Pages (WordPress#69209)

* Editor: Add an extra check before enabling the new default rendering mode for Pages
* Add backport changelog entry

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants