-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Editor: Honor rich/code editor settings when deriving the editor mode #70080
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
Editor: Honor rich/code editor settings when deriving the editor mode #70080
Conversation
Size Change: +13 B (0%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
Flaky tests detected in d74fd26. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/14890900355
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
P.S. I recall that the site editor forces richEditingEnabled
to true, so we can't disable the visual editor via the block_editor_settings_all hook
. I'll investigate if we can remove that default value separately.
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @CreativeDive. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Hi @Mamaduka, I have tested the PR and it solves the issue 👍. |
Thanks for testing, everyone! @t-hamano, I think it makes sense for the Site Editor to override that setting; it's not very useful without visual editing. |
…WordPress#70080) Unlinked contributors: CreativeDive. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org> Co-authored-by: kraftner <kraftner@git.wordpress.org>
What?
Closes #49211.
PR updates logic in the
EditorInterface
component to userichEditingEnabled
andcodeEditingEnabled
settings when deriving the editor's mode.The
editorMode
is a persistent global setting, and we shouldn't change it during editor initialization.This matches the logic in the
ModeSwitcher
component:gutenberg/packages/editor/src/components/mode-switcher/index.js
Lines 49 to 55 in 2659405
Why?
See #49211.
Testing Instructions
page
(see snippet below).post
.page
.Testing Instructions for Keyboard
Same.
Screenshots or screencast