Last active
October 30, 2017 20:37
-
-
Save vanbo/bc26183db3cd0f6ddb8d8e2e591958c7 to your computer and use it in GitHub Desktop.
WooCommerce: Hide Core notice
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
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