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/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php +19 -14 4.3.7 → 4.4.10 View file →
@@ -14,9 +14,9 @@
14 14 }
15 15
16 16 public function register_routes() {
17 17 $this->routes = array(
18 - 'course-progress' => array(
18 + /*'course-progress' => array(
19 19 array(
20 20 'methods' => WP_REST_Server::CREATABLE,
21 21 'callback' => array( $this, 'user_progress' ),
22 22 'permission_callback' => function () {
@@ -22,23 +22,23 @@
22 22 'permission_callback' => function () {
23 23 return is_user_logged_in();
24 24 },
25 25 ),
26 - ),
27 - 'course-curriculum' => array(
26 + ),*/
27 + /*'course-curriculum' => array(
28 28 array(
29 29 'methods' => WP_REST_Server::READABLE,
30 30 'callback' => array( $this, 'course_curriculum' ),
31 31 'permission_callback' => '__return_true',
32 32 ),
33 - ),
34 - 'course-curriculum-items' => array(
33 + ),*/
34 + /*'course-curriculum-items' => array(
35 35 array(
36 36 'methods' => WP_REST_Server::READABLE,
37 37 'callback' => array( $this, 'course_curriculum_items' ),
38 38 'permission_callback' => '__return_true',
39 39 ),
40 - ),
40 + ),*/
41 41 'items-progress' => array(
42 42 array(
43 43 'methods' => WP_REST_Server::READABLE,
44 44 'callback' => array( $this, 'items_progress' ),
@@ -110,14 +110,17 @@
110 110 * @author Nhamdv <[email protected]>
111 111 * @editor tungnx
112 112 * @version 1.0.1
113 113 * @sicne 4.0.0
114 + * @deprecated 4.4.0
114 115 */
115 116 public function user_progress( WP_REST_Request $request ): LP_REST_Response {
117 + _deprecated_function( __METHOD__, '4.4.0' );
118 + $response = new LP_REST_Response();
119 + return $response;
116 120 $params = $request->get_params();
117 121 $course_id = intval( $params['courseId'] ?? 0 );
118 122 $user_id = intval( $params['userId'] ?? 0 );
119 - $response = new LP_REST_Response();
120 123 $response->data = '';
121 124
122 125 try {
123 126 if ( ! $course_id || ! $user_id ) {
@@ -170,9 +173,9 @@
170 173 * use new curriculum from LP v4.2.8, so now deprecated this function
171 174 */
172 175 public function course_curriculum( WP_REST_Request $request ): LP_REST_Response {
173 176 _deprecated_function( __METHOD__, '4.2.8.7.1' );
174 - $response = new LP_REST_Response();
177 + $response = new LP_REST_Response();
175 178 return $response;
176 179 $params = $request->get_params();
177 180 $total_rows = 0;
178 181 $course_id = absint( $params['courseId'] ?? 0 );
@@ -251,18 +254,20 @@
251 254 * @return WP_REST_Response|WP_Error
252 255 * @since 4.1.5
253 256 * @version 1.0.2
254 257 * @author nhamdv
258 + * @deprecated 4.4.0
255 259 */
256 260 public function course_curriculum_items( WP_REST_Request $request ) {
261 + _deprecated_function( __METHOD__, '4.4.0' );
262 + $response = new LP_REST_Response();
263 + return $response;
257 264 $params = $request->get_params();
258 265
259 - $section_id = absint( $params['sectionId'] ?? 0 );
260 - $course_id = absint( $params['courseId'] ?? 0 );
261 - $per_page = LP_Settings::get_option( 'course_item_per_page', - 1 );
262 - $page = absint( $params['page'] ?? 1 );
263 -
264 - $response = new LP_REST_Response();
266 + $section_id = absint( $params['sectionId'] ?? 0 );
267 + $course_id = absint( $params['courseId'] ?? 0 );
268 + $per_page = LP_Settings::get_option( 'course_item_per_page', - 1 );
269 + $page = absint( $params['page'] ?? 1 );
265 270 $response->data->content = '';
266 271
267 272 try {
268 273 ob_start();