Created
April 10, 2020 21:08
-
-
Save timmyc/ee0c6f4cb3ed82620efaa16386e62c6b to your computer and use it in GitHub Desktop.
Set WooCommerce DB Update Notice as Actioned
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 | |
/** | |
* Plugin Name: Remove WooCommerce DB Notice | |
* Plugin URI: https://woocommerce.com | |
* Description: Clears out any pending WooCommerce DB Update notices | |
* Author: WooCommerce | |
* Domain Path: /languages | |
* Version: 0.1 | |
*/ | |
function woocommerce_set_database_update_notice_as_actioned() { | |
// Bail if WoocCommerce notes class is not present. | |
if ( ! class_exists( 'WC_Notes_Run_Db_Update' ) ) { | |
return; | |
} | |
$woocommerce_notes_db = new WC_Notes_Run_Db_Update(); | |
$woocommerce_notes_db->set_notice_actioned(); | |
} | |
add_action( 'admin_notices', 'woocommerce_set_database_update_notice_as_actioned' ); |
Easy fix in sql:
update wp_wc_admin_notes SET status='actioned' where name='wc-update-db-reminder';
This helped for "WooCommerce database update in progress" message, thanks!
However, I have another one too:
Is there anything similar can be done with "WooCommerce is updating product data in the background" message?
To hide the coupons notices the name on table xx_wc_admin_notes is 'wc-admin-coupon-page-moved' ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy fix in sql:
update wp_wc_admin_notes SET status='actioned' where name='wc-update-db-reminder';