Account for different DB Prefixes
-
Just a heads up you should update your
wc_delete_orders
function to account for different database prefixes.public function wc_delete_orders() { global $wpdb; $ran = true; $sql = "DELETE FROM " . $wpdb->prefix . "woocommerce_order_itemmeta"; $sql = "DELETE FROM " . $wpdb->prefix . "woocommerce_order_items"; $sql = "DELETE FROM " . $wpdb->prefix . "posts WHERE post_type = 'shop_order'"; $rows = $wpdb->query( $sql ); if( false !== $rows ) { $this->deleted = $rows; //add_action( 'admin_notices', array( $this, 'admin_notice_success' ) ); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Account for different DB Prefixes’ is closed to new replies.