Turn Off Fullscreen Mode in the Block Editor
Opens the block editor with the admin menu and toolbar visible instead of in fullscreen mode, for every user.
Opens WPIDE on
Code
add_action( 'enqueue_block_editor_assets', function () {
$script = "wp.domReady(function(){var d=wp.data;if(d.dispatch('core/preferences')){d.dispatch('core/preferences').set('core/edit-post','fullscreenMode',false);}else if(d.select('core/edit-post')&&d.select('core/edit-post').isFeatureActive('fullscreenMode')){d.dispatch('core/edit-post').toggleFeature('fullscreenMode');}});";
wp_add_inline_script( 'wp-edit-post', $script );
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.