Skip to content

Instantly share code, notes, and snippets.

@chrisvanpatten
Created April 23, 2015 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvanpatten/b2aca52932d7efde8f7c to your computer and use it in GitHub Desktop.
Save chrisvanpatten/b2aca52932d7efde8f7c to your computer and use it in GitHub Desktop.
Suppress WooCommerce nags
<?php
/**
* Suppress certain WooCommerce admin notices
*/
function suppress_woocommerce_nags() {
if ( class_exists( 'WC_Admin_Notices' ) ) {
// Remove the "you have outdated template files" nag
WC_Admin_Notices::remove_notice( 'template_files' );
// Remove the "install pages" nag
WC_Admin_Notices::remove_notice( 'install' );
}
}
add_action( 'wp_loaded', 'suppress_woocommerce_nags', 99 );
/**
* Hide the "install the WooThemes Updater" nag
*/
remove_action( 'admin_notices', 'woothemes_updater_notice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment