Skip to content

Commit

Permalink
Add a config constant to force delete plugin data when uninstalling (#74
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rilwis authored Nov 10, 2023
1 parent 11b9332 commit d68eca5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?php
defined( 'WP_UNINSTALL_PLUGIN' ) || die;

$delete_data = defined( 'MB_RELATIONSHIPS_DELETE_DATA' ) ? MB_RELATIONSHIPS_DELETE_DATA : false;
if ( ! $delete_data ) {
return;
}

global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mb_relationships" );

delete_option( 'mbr_table_created' );

0 comments on commit d68eca5

Please sign in to comment.