Skip to content
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

Post editor: revert iframed editor for WP core only #48076

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/compat/wordpress-6.2/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ function( $settings ) {
// We must override what core is passing now.
$settings['__unstableResolvedAssets'] = gutenberg_resolve_assets_override();
$settings['__unstableIsBlockBasedTheme'] = wp_is_block_theme();
// As the name suggests, this shouldn't be backported to core.
$settings['__unstableIsGutenbergPlugin'] = IS_GUTENBERG_PLUGIN;
ellatrix marked this conversation as resolved.
Show resolved Hide resolved
return $settings;
},
100
Expand Down
6 changes: 5 additions & 1 deletion packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default function VisualEditor( { styles } ) {
wrapperBlockName,
wrapperUniqueId,
isBlockBasedTheme,
isGutenbergPlugin,
} = useSelect( ( select ) => {
const {
isFeatureActive,
Expand Down Expand Up @@ -148,6 +149,7 @@ export default function VisualEditor( { styles } ) {
wrapperBlockName: _wrapperBlockName,
wrapperUniqueId: getCurrentPostId(),
isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
isGutenbergPlugin: editorSettings.__unstableIsGutenbergPlugin,
};
}, [] );
const { isCleanNewPost } = useSelect( editorStore );
Expand Down Expand Up @@ -339,7 +341,9 @@ export default function VisualEditor( { styles } ) {
>
<MaybeIframe
shouldIframe={
( isBlockBasedTheme && ! hasMetaBoxes ) ||
( isGutenbergPlugin &&
isBlockBasedTheme &&
! hasMetaBoxes ) ||
isTemplateMode ||
deviceType === 'Tablet' ||
deviceType === 'Mobile'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const BLOCK_EDITOR_SETTINGS = [
'__unstableIsPreviewMode',
'__unstableResolvedAssets',
'__unstableIsBlockBasedTheme',
'__unstableIsGutenbergPlugin',
];

/**
Expand Down