-
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
core/block-editor getSettings() does not return custom settings added from filter #68541
Comments
Hi @colinduwe,
Screenshot: |
If I remember correctly, this is intentional, and even Core doesn't expose new settings via @colinduwe, can you share more about your use case? Let's see if we can find an alternative. |
We need an extensible way to set the body class on the editor iframe. Here are two issues Here's the component with its comment that alludes to this unmet need: gutenberg/packages/block-editor/src/components/iframe/index.js Lines 144 to 152 in cad8fae
Here's a proposed way to provide for the needs (rudimentary): #68538 If we can add a bodyClasses property to $settings which is available via the 'core/block-editor' store, then extenders can use the PHP filter or modify the editor settings state to control the body classes and thus target CSS. My personal motivating use case is a theme with page templates with different background colors. The page template class should be on iframe body so it can have the proper background color. This was something we had in TinyMCE. |
If there's an alternative method for providing a bodyClasses property to the core/block-editor store, maybe we should close this issue and update the documentation for |
Description
According to https://make.wordpress.org/core/2022/05/03/block-editor-miscellaneous-dev-notes-for-wordpress-6-0/#removed-6-2, wp.data.select( 'core/editor' ).+ name has been deprecated in favor of wp.data.select( 'core/block-editor' ). + name.
When using the filter block_editor_settings_all, additional settings aren't always included in core/block-editor, for example when editing a page.
This is blocking
#68538
#17854
#56831
There is an old, closed issue but it doesn't seem to have been addressed
Step-by-step reproduction instructions
Then on post.php
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.7.1
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: