From 902882e00a0ecb9e9f7fdfb1da4ad2c5d5acfbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Ramirez=20Giraldo?= <52968528+julianramirez2@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:06:53 -0500 Subject: [PATCH] fix: undefined variable enrollment action in new enrollment request (#60) * fix: undefined variable enrollment action in new enrollment request * refactor: added required space, wpcs rules * refactor: improve the fix --------- Co-authored-by: Maria Fernanda Magallanes Zubillaga --- includes/model/class-openedx-woocommerce-plugin-enrollment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/model/class-openedx-woocommerce-plugin-enrollment.php b/includes/model/class-openedx-woocommerce-plugin-enrollment.php index 417afcc..8a09c7a 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'] ) );