-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Changelog | ||
* (29 April 2016). Allow filter by meta key/value. | ||
* (10 April 2016). Initial Release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
# WP REST API V2 Custom Post Types | ||
|
||
# WP REST API V2 Custom Post Fields | ||
==== | ||
Shows Advanced Custom Field output to the WP REST API V2 for posts. | ||
|
||
https://wordpress.org/plugins/wp-rest-api-v2-custom-post-fields/ | ||
|
||
- [Installation](#installation) | ||
- [Filters](#filters) | ||
|
||
Installation | ||
==== | ||
|
||
This plugin requires having WP API 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. | ||
|
||
|
||
Filters | ||
==== | ||
| 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` | ||
|
||
```PHP | ||
$allowed_meta_keys = array( 'custom-field-name' ); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
=== Plugin Name === | ||
Contributors: Deyan Vatsov | ||
Tags: api, json, REST, rest-api-v2, advanced custom post fields, ACF | ||
Requires at least: 4.3 | ||
Tested up to: 4.4.5 | ||
Stable tag: 0.1 | ||
License: GPLv2 or later | ||
License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
|
||
Shows Advanced Custom Field output to the WP REST API V2 for posts. | ||
|
||
== Description == | ||
|
||
This plugin combines the two of the best WordPress plugins: [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/ "Advanced Custom Fields") and [WP REST API](https://wordpress.org/plugins/rest-api/ "WP REST API"). | ||
|
||
**See details on GitHub:** https://github.com/Vatsov/wp-rest-api-v2-custom-post-fields/ | ||
|
||
== Installation == | ||
|
||
This plugin requires having WP API 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. | ||
|
||
== Changelog == | ||
|
||
= 0.2 = | ||
* Allow filter by meta key/value | ||
|
||
= 0.1 = | ||
* Initial Release. |
This file was deleted.
Oops, something went wrong.