Skip to content

Instantly share code, notes, and snippets.

@MaximeCulea
Created April 3, 2020 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaximeCulea/3e3ad3cf42c68f0dd0059a0bb9aa3705 to your computer and use it in GitHub Desktop.
Save MaximeCulea/3e3ad3cf42c68f0dd0059a0bb9aa3705 to your computer and use it in GitHub Desktop.
Gutenberg tweaks
<?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