From b10957d576bb4487fc9512fa44fef49a1d000997 Mon Sep 17 00:00:00 2001 From: "ishwar.singh" Date: Thu, 25 Jul 2024 13:13:52 +0530 Subject: [PATCH] fixed error on manual enrolment page when course is searched --- edwiser-bridge/includes/class-eb-manage-enrollment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edwiser-bridge/includes/class-eb-manage-enrollment.php b/edwiser-bridge/includes/class-eb-manage-enrollment.php index 3085c07..93be2ee 100644 --- a/edwiser-bridge/includes/class-eb-manage-enrollment.php +++ b/edwiser-bridge/includes/class-eb-manage-enrollment.php @@ -369,7 +369,7 @@ public function get_wp_post_id( $moodle_course_id ) { * Handle new enrollment of the user */ public function handle_new_enrollment() { - if ( isset( $_POST['eb-manage-user-enrol'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['eb-manage-user-enrol'] ) ), 'eb-manage-user-enrol' ) ) { + if ( isset( $_POST['eb-manage-user-enrol'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['eb-manage-user-enrol'] ) ), 'eb-manage-user-enrol' ) && isset( $_POST['new-enrollment-student'] ) && isset( $_POST['new-enrollment-courses'] ) ) { $user_id = sanitize_text_field( wp_unslash( $_POST['new-enrollment-student'] ) ); @@ -398,7 +398,7 @@ public function handle_new_enrollment() { if ( $response ) { echo '
-

' . esc_html__( 'User ', 'edwiser-bridge' ) . $user_name . esc_html__( ' has been enrolled successfully.', 'edwiser-bridge' ) . '

+

' . esc_html__( 'User ', 'edwiser-bridge' ) . esc_html( $user_name ) . esc_html__( ' has been enrolled successfully.', 'edwiser-bridge' ) . '

'; } else {