PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
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 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/custom-post-types/question.php +11 -1 4.4.8 → 4.4.9 View file →
@@ -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 );