Created
November 4, 2020 16:04
-
-
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.
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 | |
| 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