-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Zoom out: Add an Editor setting to disable Zoom out mode #68878
Conversation
Add a setting called "zoomOutEnabled" to the editor and block-editor packages. The setting defaults to true and can be filtered with block_editor_settings_all. When false, the zoom out mode is disabled.
Size Change: +58 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Side note: It's recommended that settings be exposed and consumed via REST API. Here's the latest example - #61844 (comment). |
That's a comment, not a working example or documentation / tutorial. |
Also its a comment without motivation. If its expected that contributors should be able to implement it, it needs to be a lot clearer. Should the Zoom out also be based on post type? |
If a developer wanted to disable block patterns, code editor, zoom out and change the template lock they would need to do |
I left a note regarding the best practices Core is currently following. Unfortunately, I don't have an answer specific to Zoom-out mode. To me, it's not clear where the "Zoom out" feature "lives". Is it a post-type or template specific, or is it both? In my opinion, there are a lot of nuances that need to be cleared before we introduce any settings for it. |
I have added the context to the issue and removed it from the 6.8 board. |
What?
Add a setting called "zoomOutEnabled" to the
editor
andblock-editor
packages. The setting defaults totrue
and can be filtered withblock_editor_settings_all
. Whenfalse
, the zoom out mode is disabled.Closes #63584
Why?
The reasons why the filter was requested are listed in the issue :)
Testing Instructions
This will require careful testing of both the Site Editor and block editor.
Apply the PR and activate a block theme.
The zoom out mode should be available by default: With available, I mean that all flows should work as they do without this PR.
The zoom out toggle button should work.
The zoom out should activate when the patterns tab is opened through the inserter, etc.
There should be no regressions to the zoom out mode in the block editor, when editing templates in the block editor,
or the Site Editor.
After testing for regressions it is time to disable it.
Add this basic example code to your theme , for example in fuctions.php:
Now re-test the block editor, including the "edit template" and "show template" options and the pattern inserter.
The zoom out mode should not be activated.
The toggle to enable and deactivate zoom out should not be visible.
Test the Site Editor, including the pattern inserter. The zoom out mode should not be available.
But wait we aren't finished yet!
Activate a classic theme and add the filter in the code above, for example in functions.php.
Create a new post.
Insert a group block. Set the HTML element on the group block to main in the Advanced panel of the block.
Save. The zoom out option should not be available.
Screenshots or screencast
Example of editing a post, with the zoom out option missing:

Todo:
Documentation and test.