Skip to content

Commit

Permalink
Create uninstalling process
Browse files Browse the repository at this point in the history
  • Loading branch information
DevWael committed Nov 6, 2024
1 parent dedf25b commit 2cf7c85
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Merchant Uninstall
*/

defined( 'WP_UNINSTALL_PLUGIN' ) || exit;

global $wpdb, $wp_version;

/*
* Only remove ALL merchant & merchant-pro data if WC_REMOVE_ALL_DATA constant is set to true in user's
* wp-config.php. This is to prevent data loss when deleting the plugin from the backend
* and to ensure only the site owner can perform this action. (Copied from WooCommerce).
*/
if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) {
$wpdb->query( $wpdb->prepare( "DROP TABLE IF EXISTS %s", $wpdb->prefix . 'merchant_sales_notifications' ) );
}

0 comments on commit 2cf7c85

Please sign in to comment.