Skip to content

Instantly share code, notes, and snippets.

@tyhallcsu
Created August 1, 2023 04:01
Show Gist options
  • Save tyhallcsu/fdebe1c4717ad50d90268c99ff466c92 to your computer and use it in GitHub Desktop.
Save tyhallcsu/fdebe1c4717ad50d90268c99ff466c92 to your computer and use it in GitHub Desktop.
This userscript is designed to improve the user experience on WordPress admin pages by hiding a specific element with the class .ab-sub-wrapper. The .ab-sub-wrapper element is commonly associated with the WSSO (WordPress Social Sharing Optimization) overlay, which may sometimes obstruct or interfere with the admin interface. By running this user…
// ==UserScript==
// @name Hide WSSO Overlay
// @namespace http://empathyfirstmedia.com
// @version 1.0
// @description Hides element with class .ab-sub-wrapper on WordPress admin pages
// @author Tyler Hall
// @match *://*/wp-admin/*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
// Function to add custom CSS to hide the element
function hideElementByClass(className) {
GM_addStyle('.' + className + ' { display: none !important; }');
}
// Hide the element with class .ab-sub-wrapper on WordPress admin pages
if (window.location.href.includes('/wp-admin')) {
hideElementByClass('ab-sub-wrapper');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment