Forked from timmyc/woocommerce-remove-db-update-notice.php
Last active
December 24, 2020 18:53
-
-
Save lukecav/a66a812926eb55d350e6874fb925927e to your computer and use it in GitHub Desktop.
Set WooCommerce database 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wordpress.org/support/topic/from-3-8-to-4-01-woocommerce-database-update-done-wont-go-away/
https://wordpress.org/support/topic/unable-to-close-woocommerce-database-update-done-notice/