diff --git a/uninstall.php b/uninstall.php index d8199e5337..77d33a2a59 100644 --- a/uninstall.php +++ b/uninstall.php @@ -12,11 +12,6 @@ wp_clear_scheduled_hook('directorist_hourly_scheduled_events'); function directorist_uninstall() { - - if( ! get_directorist_option('enable_uninstall',0) ) { - return; - } - global $wpdb; // Delete selected pages @@ -101,11 +96,20 @@ function directorist_uninstall() { foreach ($sites as $site) { switch_to_blog($site->blog_id); + + if( ! get_directorist_option('enable_uninstall',0) ) { + continue; + } + directorist_uninstall(); restore_current_blog(); } switch_to_blog($original_blog_id); } else { + if( ! get_directorist_option('enable_uninstall',0) ) { + return; + } + directorist_uninstall(); -} \ No newline at end of file +}