times / acf-to-wp-api

Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the 'acf' key
http://wordpress.org/plugins/acf-to-wp-api/
MIT License
203 stars 24 forks source link

Improving version detection #38

Closed connorjburton closed 7 years ago

connorjburton commented 8 years ago

Moves version retrieval to it's own function and removes need to manually check version numbers in _getAPIBaseVersion

Not fully tested so will need testing.

connorjburton commented 8 years ago

Okay, fixed a small bug, tested with V2 and it works. Not tested with V1 of WP REST API

kokarn commented 8 years ago

This needs to be merged @chrishutchinson At the moment, it fails on older WP installs due to (REST_API_VERSION) actually getting returned as a string, hence true here https://github.com/times/acf-to-wp-api/blob/master/acf-to-wp-api.php#L41

EDIT: It also fails on 4.4.2 with the old REST API plugin (1.3.5 currently)