Skip to content

Instantly share code, notes, and snippets.

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 lukecav/a66a812926eb55d350e6874fb925927e to your computer and use it in GitHub Desktop.
Save lukecav/a66a812926eb55d350e6874fb925927e to your computer and use it in GitHub Desktop.
Set WooCommerce database update notice as actioned
<?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' );