Shows Advanced Custom Field output to the WP REST API V2 for posts.
- Contributors: Deyan Vatsov
- Tags: api, json, REST, rest-api, wp-api, advanced custom post fields, ACF
- Requires at least: 4.3
- Tested up to: 4.4.5
- Stable tag: 0.2
- License: GPLv2 or later
- [Description](#description) - [Installation](#installation) - [Filters](#filters) - [Changelog](#changelog)
This plugin combines the two of the best WordPress plugins: WP REST API and Advanced Custom Fields.
Support and Requests please in GitHub.
This plugin requires having WP REST API and Advanced Custom Fields installed and activated or it won't be of any use.
-
Manual Installation:
Upload the entire /wp-rest-api-v2-custom-post-fields directory to the /wp-content/plugins/ directory. -
Better Installation:
Go to Plugins > Add New in your WordPress admin and search for 'WP REST API V2 Custom Post Fields'.
Once installed, activate 'WP REST API V2 Custom Post Fields' from WordPress plugins dashboard page and you're ready to go.
This plugin works straight out of the box.
Endpoint |
---|
/wp-json/wp/v2/posts?filter[meta_key]={custom-field-name}&filter[meta_value]={custom-field-value} |
If you want to limit the fields you have to add the allowed meta keys in 'allowed_meta_keys' array in plugin.php
$allowed_meta_keys = array( 'custom-field-name' );
- Allow filter by meta key/value.
- Initial Release.
Props [Deyan Vatsov](https://github.com/Vatsov)