varsitynewsnetwork / wordpress-rest-api-client

A Wordpress API client for PHP
77 stars 63 forks source link

Return total number of records and pages #25

Closed vkey closed 5 years ago

vkey commented 5 years ago

To determine how many pages of data are available, the API returns two header fields with every paginated response: X-WP-Total: the total number of records in the collection X-WP-TotalPages: the total number of pages encompassing all available records By inspecting these header fields you can determine how much more data is available within the API.

Just added two keys in resulting array: wp_total -> X-WP-Total wp_total_pages -> X-WP-TotalPages