Skip to content

Commit

Permalink
Editor: Update post-type support key for new default rendering mode (#…
Browse files Browse the repository at this point in the history
…68745)

* Editor: Update post-type support key for new default rendering mode
* Add backport changelog entry

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
  • Loading branch information
3 people authored Jan 17, 2025
1 parent c2d2d69 commit 12709bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions backport-changelog/6.8/8123.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/8123

* https://github.com/WordPress/gutenberg/pull/68549
* https://github.com/WordPress/gutenberg/pull/68745
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.8/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function gutenberg_update_page_editor_support( $args ) {
if ( false !== $editor_support_key ) {
unset( $args['supports'][ $editor_support_key ] );
$args['supports']['editor'] = array(
'default_mode' => 'template-locked',
'default-mode' => 'template-locked',
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ export const ExperimentalEditorProvider = withRegistryProvider(

const _defaultMode = Array.isArray( postTypeSupports?.editor )
? postTypeSupports.editor.find(
( features ) => 'default_mode' in features
)?.default_mode
( features ) => 'default-mode' in features
)?.[ 'default-mode' ]
: undefined;
const hasDefaultMode = RENDERING_MODES.includes( _defaultMode );

Expand Down

0 comments on commit 12709bd

Please sign in to comment.