| @@ -34,18 +34,13 @@ | ||
| 34 | 34 | if ( ! $the_id || LP_QUIZ_CPT !== learn_press_get_post_type( $the_id ) ) { |
| 35 | 35 | throw new Exception( __( 'Invalid quiz.', 'learnpress' ) ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $quiz->set_data_via_methods( | |
| 39 | - array( | |
| 40 | - 'retake_count' => get_post_meta( $quiz->get_id(), '_lp_retake_count', true ), | |
| 41 | - 'show_result' => get_post_meta( $quiz->get_id(), '_lp_show_result', true ), | |
| 42 | - 'passing_grade_type' => get_post_meta( $quiz->get_id(), '_lp_passing_grade_type', true ), | |
| 43 | - 'passing_grade' => get_post_meta( $quiz->get_id(), '_lp_passing_grade', true ), | |
| 44 | - 'instant_check' => get_post_meta( $quiz->get_id(), '_lp_instant_check', true ), | |
| 45 | - 'review_questions' => get_post_meta( $quiz->get_id(), '_lp_review', true ), | |
| 46 | - ) | |
| 47 | - ); | |
| 38 | + $quiz->set_retake_count( get_post_meta( $quiz->get_id(), '_lp_retake_count', true ) ); | |
| 39 | + $quiz->set_passing_grade_type( get_post_meta( $quiz->get_id(), '_lp_passing_grade_type', true ) ); | |
| 40 | + $quiz->set_passing_grade( get_post_meta( $quiz->get_id(), '_lp_passing_grade', true ) ); | |
| 41 | + $quiz->set_instant_check( get_post_meta( $quiz->get_id(), '_lp_instant_check', true ) ); | |
| 42 | + $quiz->set_review_questions( get_post_meta( $quiz->get_id(), '_lp_review', true ) ); | |
| 48 | 43 | |
| 49 | 44 | $this->_load_questions( $quiz ); |
| 50 | 45 | // $this->_update_meta_cache( $quiz ); |
| 51 | 46 | |
| @@ -467,10 +462,12 @@ | ||
| 467 | 462 | * @param string $value |
| 468 | 463 | * |
| 469 | 464 | * @return mixed |
| 470 | 465 | * @since 3.1.0 |
| 466 | + * @deprecated 4.2.5 | |
| 471 | 467 | */ |
| 472 | 468 | public function get_item_by( $field, $value = '' ) { |
| 469 | + _deprecated_function( __METHOD__, '4.2.5' ); | |
| 473 | 470 | if ( $rows = $this->get_items_by( $field, $value ) ) { |
| 474 | 471 | return $rows[0]; |
| 475 | 472 | } |
| 476 | 473 | |
| @@ -484,10 +481,12 @@ | ||
| 484 | 481 | * @param string $value |
| 485 | 482 | * |
| 486 | 483 | * @return array |
| 487 | 484 | * @since 3.1.0 |
| 485 | + * @deprecated 4.2.5 | |
| 488 | 486 | */ |
| 489 | 487 | public function get_items_by( $field, $value = '' ) { |
| 488 | + _deprecated_function( __METHOD__, '4.2.5' ); | |
| 490 | 489 | global $wpdb; |
| 491 | 490 | |
| 492 | 491 | $where = ''; |
| 493 | 492 | $order = 'ORDER BY user_item_id DESC'; |