Skip to content

Commit

Permalink
Merge pull request #123 from a8cteam51/fix/issue_99
Browse files Browse the repository at this point in the history
Delete Woo memberships
  • Loading branch information
NickGreen authored Jun 10, 2024
2 parents 7be79fc + 1d500ca commit 5748b38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function delete_users_and_orders() {
$wpdb->query( "DELETE FROM $wpdb->posts WHERE post_type = 'shop_order'" );
$wpdb->query( "DELETE FROM $wpdb->posts WHERE post_type = 'shop_subscription'" );

// Delete Woo memberships
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE post_id IN ( SELECT ID FROM {$wpdb->posts} WHERE post_type = 'wc_user_membership' )" );
$wpdb->query( "DELETE FROM $wpdb->posts WHERE post_type = 'wc_user_membership'" );

// Delete data from the High Performance Order Tables
$table_name = $wpdb->prefix . 'wc_orders';
if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ) ) === $table_name ) {
Expand Down

0 comments on commit 5748b38

Please sign in to comment.