Giter Club home page Giter Club logo

Comments (7)

jack-pallot avatar jack-pallot commented on June 3, 2024 5

I'm happy to submit a PR since this seems to be working. I'm guessing it should probably just target ACF 5.12 and above to avoid breaking any older code.

from acf-to-rest-api.

danman335 avatar danman335 commented on June 3, 2024

Yep seeing that here also.

from acf-to-rest-api.

thrugl avatar thrugl commented on June 3, 2024

Me three

from acf-to-rest-api.

jack-pallot avatar jack-pallot commented on June 3, 2024

I'm having a difficult time replicating this, to the point I can't submit a PR, but I believe the fix is the following:

add_action( 'rest_api_init', array( __CLASS__, 'create_rest_routes' ), 10 );

needs to be changed to:

add_action( 'rest_pre_dispatch', array( __CLASS__, 'create_rest_routes' ), 10 );

In class-acf-to-rest-api.php

from acf-to-rest-api.

willers-pm avatar willers-pm commented on June 3, 2024

Try setting "Show in REST API" to true for the field-group(s) in ACF Field Group editor. I think the setting is rather new.

from acf-to-rest-api.

n-kort avatar n-kort commented on June 3, 2024

@willers-pm that causes other errors in my case, but while testing some months back I noticed the schema is different anyway, so held off using the native acf rest support.

@jack-pallot yes changing rest_api_init to rest_pre_dispatch does fix it 🎉 That change also seems to work with ACF 5.11.4

from acf-to-rest-api.

willers-pm avatar willers-pm commented on June 3, 2024

@n-kort @jack-pallot changing rest_api_init to rest_pre_dispatch does fix it for me, too. Even for the "relationship"-field where activating the setting in ACF would not fix it. So thanks! :)

from acf-to-rest-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.