ACF to REST API - Version 3.3.3

Version Description

fix issue with ACF 5.12 ( https://github.com/airesvsg/acf-to-rest-api/issues/398 ) - Thanks to Jack Pallot

Download this release

Release Info

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

Code changes from version 3.3.2 to 3.3.3

Files changed (3) hide show
  1. class-acf-to-rest-api.php +6 -4
  2. composer.json +25 -25
  3. readme.txt +6 -3
class-acf-to-rest-api.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Exposes Advanced Custom Fields Endpoints in the WordPress REST API
5
  * Author: Aires Gonçalves
6
  * Author URI: http://github.com/airesvsg
7
- * Version: 3.3.2
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 = '3.3.2';
20
 
21
  private static $old_request_version = 2;
22
  private static $default_request_version = 3;
@@ -67,10 +67,12 @@ if ( ! class_exists( 'ACF_To_REST_API' ) ) {
67
  }
68
 
69
  private static function hooks() {
70
- add_action( 'init', array( __CLASS__, 'load_plugin_textdomain' ) );
 
71
 
 
72
  if ( self::is_plugin_active( 'all' ) ) {
73
- add_action( 'rest_api_init', array( __CLASS__, 'create_rest_routes' ), 10 );
74
  if ( self::$default_request_version == self::handle_request_version() ) {
75
  ACF_To_REST_API_ACF_Field_Settings::hooks();
76
  }
4
  * Description: Exposes Advanced Custom Fields Endpoints in the WordPress REST API
5
  * Author: Aires Gonçalves
6
  * Author URI: http://github.com/airesvsg
7
+ * Version: 3.3.3
8
  * Plugin URI: http://github.com/airesvsg/acf-to-rest-api
9
  */
10
 
16
 
17
  class ACF_To_REST_API {
18
 
19
+ const VERSION = '3.3.3';
20
 
21
  private static $old_request_version = 2;
22
  private static $default_request_version = 3;
67
  }
68
 
69
  private static function hooks() {
70
+ $acf_plugin_version = get_option( 'acf_version' );
71
+ $hook_type = $acf_plugin_version >= '5.12' ? 'rest_pre_dispatch' : 'rest_api_init';
72
 
73
+ add_action( 'init', array( __CLASS__, 'load_plugin_textdomain' ) );
74
  if ( self::is_plugin_active( 'all' ) ) {
75
+ add_action( $hook_type, array( __CLASS__, 'create_rest_routes' ), 10 );
76
  if ( self::$default_request_version == self::handle_request_version() ) {
77
  ACF_To_REST_API_ACF_Field_Settings::hooks();
78
  }
composer.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "name": "airesvsg/acf-to-rest-api",
3
- "description": "Exposes Advanced Custom Fields Endpoints in the WordPress REST API",
4
- "type": "wordpress-plugin",
5
- "version": "3.3.2",
6
- "keywords": ["wordpress", "wp", "rest-api", "acf", "wp-api", "json", "wordpres-plugin", "fields"],
7
- "homepage": "https://github.com/airesvsg/acf-to-rest-api",
8
- "license": "GPL-2.0-only",
9
- "authors": [
10
- {
11
- "name": "Aires Gonçalves",
12
- "email": "airesvsg@gmail.com",
13
- "homepage": "http://airesgoncalves.com",
14
- "role": "Developer"
15
- }
16
- ],
17
- "support": {
18
- "email": "airesvsg@gmail.com",
19
- "issues": "https://github.com/airesvsg/acf-to-rest-api/issues"
20
- },
21
- "require": {
22
- "php": ">=5.3.2",
23
- "composer/installers": "~1.0"
24
- }
25
- }
1
+ {
2
+ "name": "airesvsg/acf-to-rest-api",
3
+ "description": "Exposes Advanced Custom Fields Endpoints in the WordPress REST API",
4
+ "type": "wordpress-plugin",
5
+ "version": "3.3.3",
6
+ "keywords": ["wordpress", "wp", "rest-api", "acf", "wp-api", "json", "wordpres-plugin", "fields"],
7
+ "homepage": "https://github.com/airesvsg/acf-to-rest-api",
8
+ "license": "GPL-2.0-only",
9
+ "authors": [
10
+ {
11
+ "name": "Aires Gonçalves",
12
+ "email": "airesvsg@gmail.com",
13
+ "homepage": "http://airesgoncalves.com",
14
+ "role": "Developer"
15
+ }
16
+ ],
17
+ "support": {
18
+ "email": "airesvsg@gmail.com",
19
+ "issues": "https://github.com/airesvsg/acf-to-rest-api/issues"
20
+ },
21
+ "require": {
22
+ "php": ">=5.3.2",
23
+ "composer/installers": "~1.0"
24
+ }
25
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === ACF to REST API ===
2
  Contributors: airesvsg
3
- Donate link: https://www.paypal.com/donate?hosted_button_id=P4DVDKW4ZV7GE&source=url
4
  Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api, wordpress-rest-api
5
  Requires at least: 4.6
6
- Tested up to: 5.9
7
- Stable tag: 3.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -21,6 +21,9 @@ Exposes [Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-f
21
 
22
  == Changelog ==
23
 
 
 
 
24
  = 3.3.2 =
25
  updating donation link
26
 
1
  === ACF to REST API ===
2
  Contributors: airesvsg
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=E5M7HDWNPFVF4&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, wordpress-rest-api
5
  Requires at least: 4.6
6
+ Tested up to: 5.9.1
7
+ Stable tag: 3.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
21
 
22
  == Changelog ==
23
 
24
+ = 3.3.3 =
25
+ fix issue with ACF 5.12 ( https://github.com/airesvsg/acf-to-rest-api/issues/398 ) - Thanks to Jack Pallot
26
+
27
  = 3.3.2 =
28
  updating donation link
29