LLMS_REST_Enrollments_Controller::get_items( WP_REST_Request $request )
Get a collection of enrollments.
Parameters Parameters
- $request
-
(WP_REST_Request) (Required) Full details about the request.
Return Return
(WP_Error|WP_REST_Response)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-enrollments-controller.php
public function get_items( $request ) { $response = parent::get_items( $request ); // Specs require 404 when no course enrollments are found. if ( ! is_wp_error( $response ) && empty( $response->data ) ) { return llms_rest_not_found_error(); } return $response; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.7 | Overrides the parent get_items() for the only purpose of returning a 404 if no enrollments are found. |
1.0.0-beta.3 | Don't output "Last" page link header on the last page. |
1.0.0-beta.1 | Introduced. |