Skip to content

Commit

Permalink
Update uninstall.php
Browse files Browse the repository at this point in the history
Fixes #187
  • Loading branch information
ajaydsouza committed Oct 5, 2023
1 parent b43d736 commit d81c4bf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

if ( is_multisite() ) {

// Get all blogs in the network and activate plugin on each one.
$blogids = $wpdb->get_col( //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
"
SELECT blog_id FROM $wpdb->blogs
WHERE archived = '0' AND spam = '0' AND deleted = '0'
"
$sites = get_sites(
array(
'archived' => 0,
'spam' => 0,
'deleted' => 0,
)
);

foreach ( $blogids as $blogid ) {
switch_to_blog( $blogid );
foreach ( $sites as $site ) {
switch_to_blog( (int) $site->blog_id );
crp_delete_data();
restore_current_blog();
}
Expand Down

0 comments on commit d81c4bf

Please sign in to comment.