From a1f50e6f0d8a57da4c836054275e88743d2c2c8a Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Wed, 15 Apr 2026 16:00:10 +0600 Subject: [PATCH 1/2] blocked / pending instructor are redirecting to instructor dashboard instead of student if profile mode is save as instructor. --- classes/Instructors_List.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/Instructors_List.php b/classes/Instructors_List.php index 39f1983807..f690a73c28 100644 --- a/classes/Instructors_List.php +++ b/classes/Instructors_List.php @@ -303,6 +303,7 @@ protected static function remove_instructor_role( int $instructor_id, string $st $instructor_id = sanitize_text_field( $instructor_id ); $status = sanitize_text_field( $status ); update_user_meta( $instructor_id, '_tutor_instructor_status', $status ); + update_user_meta( $instructor_id, User::VIEW_MODE_USER_META, User::VIEW_AS_STUDENT ); $instructor = new \WP_User( $instructor_id ); $instructor->remove_role( tutor()->instructor_role ); } From 0c1828603dc981b307f3f70ad5eaecba64bd0566 Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Thu, 16 Apr 2026 10:53:35 +0600 Subject: [PATCH 2/2] comment added --- classes/Instructors_List.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/Instructors_List.php b/classes/Instructors_List.php index d55331cc03..e357f15127 100644 --- a/classes/Instructors_List.php +++ b/classes/Instructors_List.php @@ -303,6 +303,7 @@ protected static function remove_instructor_role( int $instructor_id, string $st $instructor_id = sanitize_text_field( $instructor_id ); $status = sanitize_text_field( $status ); update_user_meta( $instructor_id, '_tutor_instructor_status', $status ); + // Set view as student for blocked and pending instructor. update_user_meta( $instructor_id, User::VIEW_MODE_USER_META, User::VIEW_AS_STUDENT ); $instructor = new \WP_User( $instructor_id ); $instructor->remove_role( tutor()->instructor_role );