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/lesson.php +11 -1 4.4.8 → 4.4.9 View file →
@@ -123,8 +123,12 @@
123 123 return $posts;
124 124 }
125 125
126 126 // Check screen
127 + if ( ! function_exists( 'get_current_screen' ) ) {
128 + return $posts;
129 + }
130 +
127 131 $curren_screen = get_current_screen();
128 132 if ( ! $curren_screen || $curren_screen->id !== 'edit-' . LP_LESSON_CPT ) {
129 133 return $posts;
130 134 }
@@ -151,9 +155,15 @@
151 155
152 156 $filter = new LessonPostFilter();
153 157 $filter->page = $paged;
154 158 $filter->limit = $posts_per_page;
155 - $filter->only_fields = [ 'p.ID', 'p.post_title', 'p.post_author', 'p.post_date', 'p.post_date_gmt' ];
159 + $filter->only_fields = array_map(
160 + function ( $field ) {
161 + return "p.{$field}";
162 + },
163 + $filter->all_fields
164 + );
165 + $filter->field_count = 'p.ID';
156 166 $post_db = PostDB::getInstance();
157 167
158 168 if ( ! empty( $status ) ) {
159 169 $filter->post_status = array( $status );