Created
April 3, 2020 10:09
-
-
Save MaximeCulea/3e3ad3cf42c68f0dd0059a0bb9aa3705 to your computer and use it in GitHub Desktop.
Gutenberg tweaks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'enqueue_block_editor_assets', 'disable_editor_fullscreen' ); | |
function disable_editor_fullscreen() { | |
if ( ! is_admin() ) { | |
return; | |
} | |
wp_add_inline_script( 'wp-blocks', "jQuery( window ).load(function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } });" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment