From 675d8d92a86b07600c7d83385a07908d96788c27 Mon Sep 17 00:00:00 2001 From: Sazedul Haque Date: Thu, 30 Jan 2025 13:58:54 +0600 Subject: [PATCH] Exclude payment from checkout if plugin not active --- includes/tutor-general-functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/tutor-general-functions.php b/includes/tutor-general-functions.php index a9f0e5f75..78d659571 100644 --- a/includes/tutor-general-functions.php +++ b/includes/tutor-general-functions.php @@ -1448,6 +1448,13 @@ function tutor_get_all_active_payment_gateways() { continue; } + $name = $method['name']; + $basename = "tutor-{$name}/tutor-{$name}.php"; + $is_plugin_activated = is_plugin_active( $basename ); + if ( ! $is_manual && ! $is_plugin_activated ) { + continue; + } + $fields = $method['fields']; unset( $method['fields'] );