From 8169a2d40079a27e926a02bde79720d014497e6f Mon Sep 17 00:00:00 2001 From: etchirag Date: Fri, 4 Oct 2024 12:58:55 +0530 Subject: [PATCH] Minor changes --- php/rest-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/rest-api.php b/php/rest-api.php index eb573c9b..5591619c 100644 --- a/php/rest-api.php +++ b/php/rest-api.php @@ -575,7 +575,7 @@ function qsm_rest_get_questions( WP_REST_Request $request ) { $linked_question_ids = array_filter( isset( $question['linked_question'] ) ? explode(',', $question['linked_question']) : array() ); if ( ! empty($linked_question_ids) ) { $quiz_results = $wpdb->get_results( "SELECT `quiz_id`, `question_id` FROM `{$wpdb->prefix}mlw_questions` WHERE `question_id` IN (" . implode( ',', $linked_question_ids ) . ")" ); - foreach ( $quiz_results as $key => $value ) { + foreach ( $quiz_results as $value ) { if ( ! in_array($value->question_id, $procesed_question_ids) ) { $quiz_name_in_loop = $wpdb->get_row( $wpdb->prepare( "SELECT quiz_name FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id = %d", $value->quiz_id ), ARRAY_A ); $quiz_name_in_loop = isset( $quiz_name_in_loop['quiz_name'] ) ? $quiz_name_in_loop['quiz_name'] : '';