-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Move default redering mode setting to block_editor_settings_all
hook in PHP to allow customizing it
#61844
Move default redering mode setting to block_editor_settings_all
hook in PHP to allow customizing it
#61844
Conversation
…in PHP to allow customizing it
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. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-editor-settings.php |
Size Change: -17 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
Flaky tests detected in 8e35248. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9186719342
|
I understand the reason for this, but I'm not sure I agree with the solution personally. For instance I don't think all CPTs from the site editor should have the same default rendering mode. I personally would prefer a CPT property instead (like we do for template) |
@youknowriad I agree with the fact that it should be a property of the post types. Looking at the They may be a property of the post type. But they get piped to the editor via the block editor settings hook. So I think this PR is the first step of getting us there :) |
I think using block editor settings hook for this is not the right thing (and it's not the right thing for template/templateLock either but it's history now :P). Can we instead add these properties to the the post types REST API instead? |
@@ -0,0 +1,3 @@ | |||
https://github.com/WordPress/wordpress-develop/pull/6601 | |||
|
|||
* https://github.com/WordPress/gutenberg/pull/61844 |
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.
Thank you ❤️
Closing in favor of #62304 |
What?
Moves the
defaultRenderingMode
property from being hardcoded in JS to being an option set in PHP via theblock_editor_settings_all
hook.Why?
To allow extenders to change the default rendering mode for their custom post types.
How?
By moving the property to the
block_editor_settings_all
hook.Testing Instructions
To test that this functions properly you can either add your own custom filter on the
block_editor_settings_all
hook and modify thedefaultRenderingMode
through that, or you can change this line here:gutenberg/lib/block-editor-settings.php
Line 149 in 9ef296a