From 16bd961b0ca69cdc9a2c5644857ce3645865e382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehedi=20Hasan=20=20=E2=9A=A1=EF=B8=8F?= Date: Sun, 7 Jul 2024 12:42:51 +0600 Subject: [PATCH 1/2] rewrite the check of uninstall.php --- uninstall.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/uninstall.php b/uninstall.php index d8199e5337..1996a4d720 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) ) { + return; + } + 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 From 2e80cfd8158aed2ecae46885327dd2808ffd851c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehedi=20Hasan=20=20=E2=9A=A1=EF=B8=8F?= <43073560+HeyMehedi@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:08:19 +0600 Subject: [PATCH 2/2] Update uninstall.php --- uninstall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uninstall.php b/uninstall.php index 1996a4d720..77d33a2a59 100644 --- a/uninstall.php +++ b/uninstall.php @@ -98,7 +98,7 @@ function directorist_uninstall() { switch_to_blog($site->blog_id); if( ! get_directorist_option('enable_uninstall',0) ) { - return; + continue; } directorist_uninstall(); @@ -112,4 +112,4 @@ function directorist_uninstall() { } directorist_uninstall(); -} \ No newline at end of file +}