| @@ -28,10 +28,11 @@ | ||
| 28 | 28 | |
| 29 | 29 | <div class="form-field lp_course_faq_meta_box"> |
| 30 | 30 | <label for="_lp_key_features"><?php echo wp_kses_post( $this->label ); ?></label> |
| 31 | 31 | <div class="lp_course_faq_meta_box__content"> |
| 32 | + <input type="hidden" name="<?php echo esc_attr( $this->id ) ?>" value=""> | |
| 32 | 33 | <div class="lp_course_faq_meta_box__fields"> |
| 33 | - <?php if ( ! empty( $faqs[0][0] ) ) : ?> | |
| 34 | + <?php if ( is_array( $faqs ) && ! empty( $faqs[0][0] ) ) : ?> | |
| 34 | 35 | <?php foreach ( $faqs as $key => $faq ) : ?> |
| 35 | 36 | <div class="lp_course_faq_meta_box__field"> |
| 36 | 37 | <label> |
| 37 | 38 | <span><?php esc_attr_e( 'Title', 'learnpress' ); ?></span> |
| @@ -74,10 +75,10 @@ | ||
| 74 | 75 | <?php |
| 75 | 76 | } |
| 76 | 77 | |
| 77 | 78 | public function save( $post_id ) { |
| 78 | - $faqs_question = isset( $_POST['_lp_faqs_question'] ) ? LP_Helper::sanitize_params_submitted( $_POST['_lp_faqs_question'], 'html' ) : array(); | |
| 79 | - $faqs_answer = isset( $_POST['_lp_faqs_answer'] ) ? LP_Helper::sanitize_params_submitted( $_POST['_lp_faqs_answer'], 'html' ) : array(); | |
| 79 | + $faqs_question = LP_Request::get_param( '_lp_faqs_question', [], 'html' ); | |
| 80 | + $faqs_answer = LP_Request::get_param( '_lp_faqs_answer', [], 'html' ); | |
| 80 | 81 | |
| 81 | 82 | $faqs = array(); |
| 82 | 83 | if ( ! empty( $faqs_question ) ) { |
| 83 | 84 | $faqs_question_size = count( $faqs_question ); |