Skip to content

Instantly share code, notes, and snippets.

@KryptikOne
Created November 4, 2020 16:04
Show Gist options
  • Select an option

  • Save KryptikOne/6d80baaf90f7e4cfc9b8246d49ff5ed3 to your computer and use it in GitHub Desktop.

Select an option

Save KryptikOne/6d80baaf90f7e4cfc9b8246d49ff5ed3 to your computer and use it in GitHub Desktop.
Function to add to functions.php that will toggle the Fullscreen editor off on the WP Admin.
<?php
if (is_admin()) {
function pa_disable_fullscreen_wp_editor() {
$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', 'pa_disable_fullscreen_wp_editor');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment