LLMS_REST_Webhooks_Controller::get_pagination_data_from_query( LLMS_REST_Webhooks_Query $query, array $prepared, WP_REST_Request $request )
Retrieve pagination information from an objects query.
Parameters Parameters
- $query
-
(LLMS_REST_Webhooks_Query) (Required) Objects query result returned by LLMS_REST_Webhooks_Controller::get_objects_query().
- $prepared
-
(array) (Required) Array of collection arguments.
- $request
-
(WP_REST_Request) (Required) Request object.
Return Return
(array) Array of pagination information.
- 'current_page'
(int) Current page number. - 'total_results'
(int) Total number of results. - 'total_pages'
(int) Total number of results pages.
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-webhooks-controller.php
protected function get_pagination_data_from_query( $query, $prepared, $request ) { return array( 'current_page' => $query->get( 'page' ), 'total_results' => $query->get_found_results(), 'total_pages' => $query->get_max_pages(), ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.3 | |
1.0.0-beta-24 | Introduced. |