Disable TinyMCE: Warning instead of direct redirect#77747
Conversation
3c754cc to
a818bc0
Compare
|
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 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. |
|
Size Change: 0 B Total Size: 7.82 MB ℹ️ View Unchanged
|
|
cc @yuliyan with whom we paired on this 😉 |
|
Flaky tests detected in d07c4c6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25061265816
|
|
|
||
| // Warn the user that they need to reload the page with TinyMCE enabled. | ||
| wp.data.dispatch( wp.notices.store ).createWarningNotice( noticeText, { | ||
| actions: [ |
There was a problem hiding this comment.
Let's add an id to the notice options to prevent rendering duplicate notices of the same type.
There was a problem hiding this comment.
Good call. This actually allows us to simplify the check later, so it would rely on ID and not on the actual string.
Addressed in 899bb5b.

What?
Display a warning instead of directly redirecting in the Disable TinyMCE experiment.
Why?
Currently, if the "Disable TinyMCE" experiment is enabled and we detect TinyMCE usage, we redirect without question. This is a bit intrusive and actually might break stuff. One example is that on mobile, it breaks the media library (see https://github.com/WordPress/WordPress/blob/eff2ed0b2d18982c5dd439e316545d6a91b95781/wp-includes/js/media-views.js#L8417).
How?
We're displaying a warning with a link. That way, the user can click the link when they're ready, instead of being redirected without prior notice. In case there's an error and the warning was not displayed, we're forcing a redirect.
Testing Instructions
window.tinymce.asdin the console.Testing Instructions for Keyboard
Same
Screenshots or screencast
Use of AI Tools
Opus 4.7