Created
January 13, 2026 04:26
-
-
Save TanvirHasan19/ac7958ec80e779066ab552c1ebc8255b to your computer and use it in GitHub Desktop.
Hide the Helpful Resources and Plugins & Licenses cards with CSS and JavaScript
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
| /** | |
| * Hide the Helpful Resources and Plugins & Licenses cards with CSS and JavaScript | |
| */ | |
| function hide_wcv_dashboard_sections() { | |
| // Only load on the marketplace dashboard page | |
| $screen = get_current_screen(); | |
| if ( ! $screen || 'wc-vendors_page_wc-vendors-marketplace-dashboard' !== $screen->id ) { | |
| return; | |
| } | |
| ?> | |
| <style type="text/css"> | |
| /* Hide the Helpful Resources card */ | |
| .helpful-links-card { | |
| display: none !important; | |
| } | |
| </style> | |
| <script type="text/javascript"> | |
| (function() { | |
| // Hide the elements immediately if they exist | |
| function hideDashboardSections() { | |
| // Hide Helpful Resources | |
| var helpfulCards = document.querySelectorAll('.helpful-links-card'); | |
| helpfulCards.forEach(function(card) { | |
| card.style.display = 'none'; | |
| }); | |
| // Hide Plugins & Licenses | |
| var licenseCards = document.querySelectorAll('.license-info-card'); | |
| licenseCards.forEach(function(card) { | |
| card.style.display = 'none'; | |
| }); | |
| } | |
| // Run immediately | |
| hideDashboardSections(); | |
| // Also run after DOM is ready | |
| if (document.readyState === 'loading') { | |
| document.addEventListener('DOMContentLoaded', hideDashboardSections); | |
| } | |
| // Also run after a short delay to catch Vue-rendered content | |
| setTimeout(hideDashboardSections, 100); | |
| setTimeout(hideDashboardSections, 500); | |
| setTimeout(hideDashboardSections, 1000); | |
| })(); | |
| </script> | |
| <?php | |
| } | |
| add_action( 'admin_head', 'hide_wcv_dashboard_sections' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment