LLMS_REST_Controller_Stubs::get_pagination_data_from_query( obj $query, array $prepared, WP_REST_Request $request )
Retrieve pagination information from an objects query.
Parameters Parameters
- $query
-
(obj) (Required) Objects query result.
- $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/abstracts/class-llms-rest-controller-stubs.php
protected function get_pagination_data_from_query( $query, $prepared, $request ) { // Translators: %s = method name. _doing_it_wrong( 'LLMS_REST_Controller::get_pagination_data_from_query', sprintf( __( "Method '%s' must be overridden.", 'lifterlms' ), __METHOD__ ), '1.0.0-beta.1' ); // For example. return array( 'current_page' => 1, 'total_results' => 1, 'total_pages' => 1, ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |