diff --git a/includes/model/class-openedx-woocommerce-plugin-enrollment.php b/includes/model/class-openedx-woocommerce-plugin-enrollment.php index 64d0fec6..8a09c7ad 100644 --- a/includes/model/class-openedx-woocommerce-plugin-enrollment.php +++ b/includes/model/class-openedx-woocommerce-plugin-enrollment.php @@ -214,7 +214,8 @@ public function save_action( $post_id, $post ) { return; } - $enrollment_arr = array(); + $enrollment_arr = array(); + $enrollment_action = ''; if ( isset( $_POST['enrollment_course_id'] ) ) { $enrollment_arr['enrollment_course_id'] = sanitize_text_field( wp_unslash( $_POST['enrollment_course_id'] ) ); @@ -267,10 +268,6 @@ public function save_action( $post_id, $post ) { $enrollment_action = 'enrollment_sync'; } - if ( ! isset( $enrollment_action ) ) { - $enrollment_action = ''; - } - $this->save_enrollment( $post, $enrollment_arr, $enrollment_action ); }