ACF to REST API - Version 2.2.1

Version Description

bugfix options page id

Download this release

Release Info

Developer airesvsg
Plugin Icon 128x128 ACF to REST API
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.2.0 to 2.2.1

class-acf-to-rest-api.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /**
3
  * Plugin Name: ACF to REST API
4
- * Description: Exposes Advanced Custom Fields Endpoints in the WP REST API v2 ( WP-API | WordPress REST API )
5
  * Author: Aires Gonçalves
6
  * Author URI: http://github.com/airesvsg
7
- * Version: 2.2.0
8
  * Plugin URI: http://github.com/airesvsg/acf-to-rest-api
9
  */
10
 
@@ -16,7 +16,7 @@ if ( ! class_exists( 'ACF_To_REST_API' ) ) {
16
 
17
  class ACF_To_REST_API {
18
 
19
- const VERSION = '2.2.0';
20
 
21
  public static function init() {
22
  self::includes();
1
  <?php
2
  /**
3
  * Plugin Name: ACF to REST API
4
+ * Description: Exposes Advanced Custom Fields Endpoints in the WP REST API v2
5
  * Author: Aires Gonçalves
6
  * Author URI: http://github.com/airesvsg
7
+ * Version: 2.2.1
8
  * Plugin URI: http://github.com/airesvsg/acf-to-rest-api
9
  */
10
 
16
 
17
  class ACF_To_REST_API {
18
 
19
+ const VERSION = '2.2.1';
20
 
21
  public static function init() {
22
  self::includes();
lib/endpoints/class-acf-to-rest-api-controller.php CHANGED
@@ -179,11 +179,13 @@ if ( ! class_exists( 'ACF_To_REST_API_Controller' ) ) {
179
  $this->id = $taxonomy . '_' . $this->id;
180
  break;
181
  case 'option' :
182
- $this->id = 'option';
183
  break;
184
  }
185
-
186
- return apply_filters( 'acf/rest_api/id', $this->id );
 
 
187
  }
188
 
189
  protected function get_fields( $request, $response = null, $object = null ) {
179
  $this->id = $taxonomy . '_' . $this->id;
180
  break;
181
  case 'option' :
182
+ $this->id = 'options';
183
  break;
184
  }
185
+
186
+ $this->id = apply_filters( 'acf/rest_api/id', $this->id );
187
+
188
+ return $this->id;
189
  }
190
 
191
  protected function get_fields( $request, $response = null, $object = null ) {
readme.md CHANGED
@@ -1,6 +1,6 @@
1
  ACF to REST API
2
  ====
3
- Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/) Endpoints in the [WP REST API v2](https://wordpress.org/plugins/rest-api/) ( WP-API | WordPress REST API )
4
 
5
  https://wordpress.org/plugins/acf-to-rest-api/
6
 
@@ -9,6 +9,7 @@ https://wordpress.org/plugins/acf-to-rest-api/
9
  - [Filters](#filters)
10
  - [Editing the fields](#editing-the-fields)
11
  - [Example](#example)
 
12
 
13
  Installation
14
  ====
@@ -21,21 +22,21 @@ Endpoints
21
  | Endpoint | READABLE | EDITABLE |
22
  |----------|:--------:|:--------:|
23
  | /wp-json/acf/v2/post/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
24
- | /wp-json/acf/v2/post/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
25
  | /wp-json/acf/v2/page/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
26
- | /wp-json/acf/v2/page/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
27
  | /wp-json/acf/v2/user/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
28
- | /wp-json/acf/v2/user/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
29
  | /wp-json/acf/v2/term/**{taxonomy}**/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
30
- | /wp-json/acf/v2/term/**{taxonomy}**/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
31
  | /wp-json/acf/v2/comment/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
32
- | /wp-json/acf/v2/comment/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
33
  | /wp-json/acf/v2/media/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
34
- | /wp-json/acf/v2/media/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
35
  | /wp-json/acf/v2/**{post-type}**/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
36
- | /wp-json/acf/v2/**{post-type}**/**{id}**/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
37
  | /wp-json/acf/v2/options | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
38
- | /wp-json/acf/v2/options/**{field_name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
39
 
40
  Filters
41
  ====
@@ -123,3 +124,9 @@ Example
123
  Sample theme to edit the ACF Fields.
124
 
125
  https://github.com/airesvsg/acf-to-rest-api-example
 
 
 
 
 
 
1
  ACF to REST API
2
  ====
3
+ Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/) Endpoints in the [WP REST API v2](https://wordpress.org/plugins/rest-api/)
4
 
5
  https://wordpress.org/plugins/acf-to-rest-api/
6
 
9
  - [Filters](#filters)
10
  - [Editing the fields](#editing-the-fields)
11
  - [Example](#example)
12
+ - [Cache](#cache)
13
 
14
  Installation
15
  ====
22
  | Endpoint | READABLE | EDITABLE |
23
  |----------|:--------:|:--------:|
24
  | /wp-json/acf/v2/post/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
25
+ | /wp-json/acf/v2/post/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
26
  | /wp-json/acf/v2/page/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
27
+ | /wp-json/acf/v2/page/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
28
  | /wp-json/acf/v2/user/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
29
+ | /wp-json/acf/v2/user/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
30
  | /wp-json/acf/v2/term/**{taxonomy}**/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
31
+ | /wp-json/acf/v2/term/**{taxonomy}**/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
32
  | /wp-json/acf/v2/comment/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
33
+ | /wp-json/acf/v2/comment/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
34
  | /wp-json/acf/v2/media/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
35
+ | /wp-json/acf/v2/media/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
36
  | /wp-json/acf/v2/**{post-type}**/**{id}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
37
+ | /wp-json/acf/v2/**{post-type}**/**{id}**/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
38
  | /wp-json/acf/v2/options | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
39
+ | /wp-json/acf/v2/options/**{field-name}** | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) | ![yes](http://airesgoncalves.com.br/screenshot/acf-to-rest-api/readme/yes.png) |
40
 
41
  Filters
42
  ====
124
  Sample theme to edit the ACF Fields.
125
 
126
  https://github.com/airesvsg/acf-to-rest-api-example
127
+
128
+ Cache
129
+ ====
130
+ Enable caching for WordPress REST API and increase speed of your application.
131
+
132
+ https://github.com/airesvsg/wp-rest-api-cache
readme.txt CHANGED
@@ -3,15 +3,15 @@ Contributors: airesvsg
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=airesvsg%40gmail%2ecom&lc=BR&item_name=Aires%20Goncalves&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api
5
  Requires at least: 4.3
6
- Tested up to: 4.5
7
- Stable tag: 2.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Exposes Advanced Custom Fields Endpoints in the WP REST API v2 ( WP-API | WordPress REST API )
12
 
13
  == Description ==
14
- Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/) Endpoints in the [WP REST API v2](https://wordpress.org/plugins/rest-api/) ( WP-API | WordPress REST API )
15
 
16
  **See details on GitHub:** http://github.com/airesvsg/acf-to-rest-api
17
 
@@ -21,6 +21,9 @@ Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-f
21
 
22
  == Changelog ==
23
 
 
 
 
24
  = 2.2.0 =
25
  get specific field via endpoints
26
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=airesvsg%40gmail%2ecom&lc=BR&item_name=Aires%20Goncalves&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api
5
  Requires at least: 4.3
6
+ Tested up to: 4.7
7
+ Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Exposes Advanced Custom Fields Endpoints in the WP REST API v2
12
 
13
  == Description ==
14
+ Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/) Endpoints in the [WP REST API v2](https://wordpress.org/plugins/rest-api/)
15
 
16
  **See details on GitHub:** http://github.com/airesvsg/acf-to-rest-api
17
 
21
 
22
  == Changelog ==
23
 
24
+ = 2.2.1 =
25
+ bugfix options page id
26
+
27
  = 2.2.0 =
28
  get specific field via endpoints
29