Skip to content

Instantly share code, notes, and snippets.

@ChrisCree
Created September 14, 2024 16:35
Show Gist options
  • Save ChrisCree/daaa98c016d4402050e1430bf68d1ea9 to your computer and use it in GitHub Desktop.
Save ChrisCree/daaa98c016d4402050e1430bf68d1ea9 to your computer and use it in GitHub Desktop.
Remove WooCommerce 9.3 "Live" badge from Admin Bar. This code goes in theme's functions.php file.
<?php // Do not copy opening php tag
/**
* Remove WooCommerce site visibility "Live" badge from the admin bar.
*
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference.
*/
add_action( 'admin_bar_menu', 'khp_remove_woocommerce_site_visibility_badge', 999 );
function khp_remove_woocommerce_site_visibility_badge( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' );
}
@blogtutor
Copy link

Thank you!

@ChrisCree
Copy link
Author

Happy it was able to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment