Skip to content

Instantly share code, notes, and snippets.

@rosswintle
Last active February 10, 2022 17:11
Show Gist options
  • Save rosswintle/fc2689d53c61414897862ca7a056fcf9 to your computer and use it in GitHub Desktop.
Save rosswintle/fc2689d53c61414897862ca7a056fcf9 to your computer and use it in GitHub Desktop.
WordPress full-screen editor killer
// ==UserScript==
// @name WordPress Full Screen Editor killer
// @namespace http://rosswintle.uk/
// @version 0.1
// @description Auto-removes the full screen editor on WordPress sites
// @author Ross Wintle
// @match https://*/*
// @match http://*/*
// @grant none
// ==/UserScript==
// If you like this kind of thing then you'll LOVE https://turbo-admin.com/
(function() {
'use strict';
if (document.body.classList.contains('wp-admin')) {
setTimeout(() => {
document.body.classList.remove('is-fullscreen-mode');
document.body.classList.add('user-killed-fullscreen');
const newStyles = document.createElement('style');
newStyles.innerHTML = "body.user-killed-fullscreen .edit-post-fullscreen-mode-close { display: none; }";
document.body.appendChild(newStyles);
}, 2000); // You may need to change the timeout depending on how fast sites you use are.
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment