Created
October 18, 2023 17:15
-
-
Save jonschr/ebcb436f747852a0061a8d8e2df4f99e to your computer and use it in GitHub Desktop.
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
//* Disable fullscreen mode | |
add_action( 'enqueue_block_editor_assets', 'elodin_disable_fullscreen_mode' ); | |
function elodin_disable_fullscreen_mode() { | |
if ( !is_admin() ) | |
return; | |
$script = " | |
jQuery( window ).load(function() { | |
// disable fullscreenmode | |
const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); | |
if ( isFullscreenMode ) { | |
wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); | |
} | |
// disable publish check | |
wp.data.dispatch('core/editor').disablePublishSidebar(); | |
}); | |
"; | |
wp_add_inline_script( 'wp-blocks', $script ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment