Plugin Directory

Changeset 2687878


Ignore:
Timestamp:
03/03/2022 12:27:32 AM (4 years ago)
Author:
airesvsg
Message:

fix issue with ACF 5.12

Location:
acf-to-rest-api/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acf-to-rest-api/trunk/class-acf-to-rest-api.php

    r2405721 r2687878  
    55 * Author: Aires Gonçalves
    66 * Author URI: http://github.com/airesvsg
    7  * Version: 3.3.2
     7 * Version: 3.3.3
    88 * Plugin URI: http://github.com/airesvsg/acf-to-rest-api
    99 */
     
    1717    class ACF_To_REST_API {
    1818
    19         const VERSION = '3.3.2';
     19        const VERSION = '3.3.3';
    2020
    2121        private static $old_request_version     = 2;
     
    6868
    6969        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
    7073            add_action( 'init', array( __CLASS__, 'load_plugin_textdomain' ) );
    71 
    7274            if ( self::is_plugin_active( 'all' ) ) {
    73                 add_action( 'rest_api_init', array( __CLASS__, 'create_rest_routes' ), 10 );
     75                add_action( $hook_type, array( __CLASS__, 'create_rest_routes' ), 10 );
    7476                if ( self::$default_request_version == self::handle_request_version() ) {
    7577                    ACF_To_REST_API_ACF_Field_Settings::hooks();
  • acf-to-rest-api/trunk/composer.json

    r2405721 r2687878  
    33  "description": "Exposes Advanced Custom Fields Endpoints in the WordPress REST API",
    44  "type": "wordpress-plugin",
    5   "version": "3.3.2",
     5  "version": "3.3.3",
    66  "keywords": ["wordpress", "wp", "rest-api", "acf", "wp-api", "json", "wordpres-plugin", "fields"],
    77  "homepage": "https://github.com/airesvsg/acf-to-rest-api",
  • acf-to-rest-api/trunk/readme.txt

    r2678547 r2687878  
    11=== ACF to REST API ===
    22Contributors: airesvsg
    3 Donate link: https://www.paypal.com/donate?hosted_button_id=P4DVDKW4ZV7GE&source=url
     3Donate 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
    44Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api, wordpress-rest-api
    55Requires at least: 4.6
    6 Tested up to: 5.9
     6Tested up to: 5.4.2
    77Stable tag: 3.3.2
    88License: GPLv2 or later
     
    2121
    2222== Changelog ==
     23
     24= 3.3.3 =
     25fix issue with ACF 5.12 ( https://github.com/airesvsg/acf-to-rest-api/issues/398 ) - Thanks to Jack Pallot
    2326
    2427= 3.3.2 =
Note: See TracChangeset for help on using the changeset viewer.