Created
September 28, 2022 12:15
-
-
Save sinanisler/033bc81262ba3a3771a63968475a31cb to your computer and use it in GitHub Desktop.
disable wordpress fullscreen default
This file contains 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 | |
if (is_admin()) { | |
function jba_disable_editor_fullscreen_by_default() { | |
$script = "jQuery( window ).load(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', 'jba_disable_editor_fullscreen_by_default' ); | |
} | |
// sauce : https://www.wpbeginner.com/wp-tutorials/how-to-disable-fullscreen-editor-in-wordpress/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment