PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.10
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.10
4.4.10 4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 All 142 releases
← All changes | inc/custom-post-types/question.php +13 -3 4.4.8 → 4.4.10 View file →
@@ -77,9 +77,9 @@
77 77 * Add question types support answer options
78 78 *
79 79 * @since 3.3.0
80 80 */
81 - public function wp_loaded() {
81 + /*public function wp_loaded() {
82 82 $default_support_options = apply_filters(
83 83 'learn-press/default-question-types-support-answer-options',
84 84 array(
85 85 'true_or_false',
@@ -91,9 +91,9 @@
91 91
92 92 foreach ( $default_support_options as $type ) {
93 93 LP_Global::add_object_feature( 'question.' . $type, 'answer-options', 'yes' );
94 94 }
95 - }
95 + }*/
96 96
97 97 /**
98 98 * Add filters to lesson view.
99 99 *
@@ -344,8 +344,12 @@
344 344 return $posts;
345 345 }
346 346
347 347 // Check screen
348 + if ( ! function_exists( 'get_current_screen' ) ) {
349 + return $posts;
350 + }
351 +
348 352 $curren_screen = get_current_screen();
349 353 if ( ! $curren_screen || $curren_screen->id !== 'edit-' . LP_QUESTION_CPT ) {
350 354 return $posts;
351 355 }
@@ -372,9 +376,15 @@
372 376
373 377 $filter = new QuestionPostFilter();
374 378 $filter->page = $paged;
375 379 $filter->limit = $posts_per_page;
376 - $filter->only_fields = [ 'p.ID', 'p.post_title', 'p.post_author', 'p.post_date', 'p.post_date_gmt' ];
380 + $filter->only_fields = array_map(
381 + function ( $field ) {
382 + return "p.{$field}";
383 + },
384 + $filter->all_fields
385 + );
386 + $filter->field_count = 'p.ID';
377 387 $post_db = PostDB::getInstance();
378 388
379 389 if ( ! empty( $status ) ) {
380 390 $filter->post_status = array( $status );