Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active October 30, 2017 20:37
Show Gist options
  • Save vanbo/bc26183db3cd0f6ddb8d8e2e591958c7 to your computer and use it in GitHub Desktop.
Save vanbo/bc26183db3cd0f6ddb8d8e2e591958c7 to your computer and use it in GitHub Desktop.
WooCommerce: Hide Core notice
add_filter( 'woocommerce_show_admin_notice', 'prefix_show_updated_notice', 10, 2 );
function prefix_show_updated_notice( $show, $notice ) {
// Check for the notice you want to hide
// Refer to the WC_Admin_Notices::$code_notices (array keys) for the values
// Update notice?
if ( 'update' != $notice ) {
return $show;
}
// You can check for WC version in case you want to hide the notices
// only for the current version or a specific version
if ( version_compare( WC_VERSION, '3.2.1', '>' ) ) {
return $show;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment