25% off ProSNIPC25OFF

Disable Block Editor Fullscreen Mode by Default

Opens the Block Editor in windowed mode instead of fullscreen for all users.

PHPby SnipCraft
php
<?php
add_action( 'enqueue_block_editor_assets', 'scseed_disable_editor_fullscreen' );
if ( ! function_exists( 'scseed_disable_editor_fullscreen' ) ) {
    function scseed_disable_editor_fullscreen() {
        $script = "wp.domReady( function() {
            var editPost = wp.data.select( 'core/edit-post' );
            if ( editPost && editPost.isFeatureActive( 'fullscreenMode' ) ) {
                wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' );
            }
        } );";
        wp_add_inline_script( 'wp-edit-post', $script );
    }
}
#admin#block-editor#editor#gutenberg#ux