My team is attempting to get react-admin working with the WordPress REST API. We need all the standard functionality you'd expect, including filtering, sorting, and associations.
The issue is that the WordPress REST API follows slightly different conventions than the data providers listed in https://marmelab.com/react-admin/DataProviders.html.
An example inconsistency
react-admin expects Header: X-Total-Count
WordPress uses Header: X-WP-Total
Question
Is there a best practice strategy for composing an existing data provider and only slightly tweaking it to work with the WordPress API? For example, mapping the incoming X-WP-Total
header to X-Total-Count
?
I appreciate any help on solving this problem, and I'll post any updates for future viewers, thank you.