Add this PHP snippet to your functions.php file and stop banging your head every time you edit a post.
WordPress’ Gutenberg editor has come a long way and we’re still adjusting getting to some of its features, but for the most part I think the shift in the editorial process has been for the good. That said, I have not been able to get on board with the new “Fullscreen mode” that the edit screen defaults to. The minimal gain in screen space doesn’t make up for the drastic change in admin interface and loss of basic admin navigation.
Luckily, there’s a quick fix for this. Simply add the following snippet to your functions.php file and editing posts will no longer default to fullscreen mode:
/* Disable Fullscreen Mode */ function wpfox_disable_editor_fullscreen_mode() { $script = "window.onload = function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } }"; wp_add_inline_script( 'wp-blocks', $script ); } add_action( 'enqueue_block_editor_assets', 'wpfox_disable_editor_fullscreen_mode' );
And don’t worry, this doesn’t remove fullscreen mode completely. You can still flip it on if that’s your, or your clients’, cup of coffee. But at least it doesn’t default to it anymore! 🥳