From 9ef296a5165320e03735dc2b659b4ce7462e883a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Wed, 22 May 2024 08:28:53 +0200 Subject: [PATCH] move default redering mode setting to block_editor_settings_all hook in PHP to allow customizing it --- lib/block-editor-settings.php | 2 ++ packages/edit-post/src/editor.js | 1 - packages/editor/src/store/defaults.js | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/block-editor-settings.php b/lib/block-editor-settings.php index 53668e114e04cb..d98f5d0a94dbbf 100644 --- a/lib/block-editor-settings.php +++ b/lib/block-editor-settings.php @@ -146,6 +146,8 @@ function gutenberg_get_block_editor_settings( $settings ) { ); } + $settings['defaultRenderingMode'] = 'post-only'; + return $settings; } add_filter( 'block_editor_settings_all', 'gutenberg_get_block_editor_settings', 0 ); diff --git a/packages/edit-post/src/editor.js b/packages/edit-post/src/editor.js index 378265c1927788..f31fbed87cebde 100644 --- a/packages/edit-post/src/editor.js +++ b/packages/edit-post/src/editor.js @@ -78,7 +78,6 @@ function Editor( { ...settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, - defaultRenderingMode: 'post-only', } ), [ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ] ); diff --git a/packages/editor/src/store/defaults.js b/packages/editor/src/store/defaults.js index e4f86b3a7dfb21..999f16e2d39bbe 100644 --- a/packages/editor/src/store/defaults.js +++ b/packages/editor/src/store/defaults.js @@ -29,5 +29,4 @@ export const EDITOR_SETTINGS_DEFAULTS = { codeEditingEnabled: true, fontLibraryEnabled: true, enableCustomFields: undefined, - defaultRenderingMode: 'post-only', };