-
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
Try: New default rendering mode for editor via post type supports #68549
base: trunk
Are you sure you want to change the base?
Conversation
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: +32 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
).hasFinishedResolution( 'getPostType', [ post.type ] ); | ||
const _defaultMode = Array.isArray( postTypeSupports?.editor ) | ||
? postTypeSupports.editor.find( | ||
( features ) => 'default_mode' in features |
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.
What do you think about using default_mode
as the key for this option, or should I revert it to rendering_mode
?
( features ) => 'default_mode' in features | ||
)?.default_mode | ||
: undefined; | ||
const hasDefaultMode = RENDERING_MODES.includes( _defaultMode ); |
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.
Had to go with the client-side validation since it's not possible to validate arguments passed via add_post_type_support
.
I've restored the default rendering mode for Pages to Let's discuss separately whether this should remain the default mode for the "page" post type. See: #67867 (comment). |
63e4ed1
to
4517ec3
Compare
What?
Alternative to #67867.
This PR updates how the new default rendering mode can be set for a post type. It can now be specified by passing additional information about
editor
support.Why?
This method doesn't require a REST endpoint or any API-related changes. Existing
add_post_type_support
can be used to change or reset the default rendering mode.Code examples
Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast