Created
September 13, 2024 15:24
-
-
Save RiaanKnoetze/5193516e172554b8871236351e666cf1 to your computer and use it in GitHub Desktop.
Remove the site visibility badges (e.g. "Coming soon", "Store coming soon", and "Live") introduced by WooCommerce in version 9.1
This file contains 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 | |
add_action( 'admin_bar_menu', function( $wp_admin_bar ) { | |
if ( is_object( $wp_admin_bar ) && $wp_admin_bar->get_node( 'woocommerce-site-visibility-badge' ) ) { | |
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' ); | |
} | |
}, 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did not know that - my IDE flags it as an error, and I've been battling with writing JSON files recently and they definitely doesn't like an extra comma, so I was in that headspace. Cheers.