Skip to content

Commit

Permalink
Add uninstall code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Sep 15, 2024
1 parent b658caa commit e1745cd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/uninstall.php → uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
exit();
}

/**
* Path to the plugin dir.
*/
const HCAPTCHA_PATH = __DIR__;

/**
* Delete several options from 'sitemeta' table.
*
Expand Down Expand Up @@ -89,13 +94,13 @@ function hcap_cleanup_data() {

foreach ( $sites as $site ) {
// Switch to each site and delete options.
switch_to_blog( $site->blog_id );
switch_to_blog( (int) $site->blog_id );
hcap_cleanup_site_data( $all_options );
restore_current_blog();
}
}

require_once HCAPTCHA_PATH . '/vendor/autoload.php';

// Perform plugin cleanup tasks.
hcap_cleanup_data();

exit;

0 comments on commit e1745cd

Please sign in to comment.