Skip to content

Commit

Permalink
fixed error on manual enrolment page when course is searched
Browse files Browse the repository at this point in the history
  • Loading branch information
ishwar-singh-solanki committed Jul 25, 2024
1 parent 8a6a30c commit b10957d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions edwiser-bridge/includes/class-eb-manage-enrollment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) );

Expand Down Expand Up @@ -398,7 +398,7 @@ public function handle_new_enrollment() {

if ( $response ) {
echo '<div class="notice notice-success is-dismissible">
<p>' . esc_html__( 'User ', 'edwiser-bridge' ) . $user_name . esc_html__( ' has been enrolled successfully.', 'edwiser-bridge' ) . '</p>
<p>' . esc_html__( 'User ', 'edwiser-bridge' ) . esc_html( $user_name ) . esc_html__( ' has been enrolled successfully.', 'edwiser-bridge' ) . '</p>
</div>
';
} else {
Expand Down

0 comments on commit b10957d

Please sign in to comment.