Update delete_obsolete_notes to use $wpdb directly to delete the notes -- note store is not available when the plugin is activated via CLI

This commit is contained in:
moon 2022-04-07 12:55:20 -07:00
parent ae6a658578
commit 1ca12a8784
1 changed files with 5 additions and 1 deletions

View File

@ -745,6 +745,7 @@ class WC_Install {
* Delete obsolete notes.
*/
public static function delete_obsolete_notes() {
global $wpdb;
$obsolete_notes_names = array(
'wc-admin-welcome-note',
'wc-admin-store-notice-setting-moved',
@ -780,7 +781,10 @@ class WC_Install {
);
}
Notes::delete_notes_with_name( $obsolete_notes_names );
foreach ( $obsolete_notes_names as $obsolete_notes_name ) {
$wpdb->delete( $wpdb->prefix . 'wc_admin_notes', array( 'name' => $obsolete_notes_name ) );
$wpdb->delete( $wpdb->prefix . 'wc_admin_note_actions', array( 'name' => $obsolete_notes_name ) );
}
}
/**