flutter_wordpress icon indicating copy to clipboard operation
flutter_wordpress copied to clipboard

ACF Support

Open chaselifetech opened this issue 4 years ago • 2 comments

Hello, is there any support for acf? Thank you David

chaselifetech avatar Apr 25 '20 08:04 chaselifetech

The problem with ACF is that you have to create your custom endpoints on the WordPress REST API for it to work, and it's not something you would like to include in a plugin that is designed to work with the standard that WordPress has already created. I'm doing the same setup as you and I had to create a custom wordpress plugin that extends the WordPress REST which in turn calls ACF functions.

After you have your custom endpoints in place then you have to create your own functions inside of Flutter designed to send HTTP requests and parsing JSon to Dart objects, you can use Dart standard HTTP functions or dio for the task + json serializable.

I'll leave you some links from the official Wordpress docs regarding adding new endpoints to WordPress, seriously is not that complicated.

https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/

https://flutter.dev/docs/development/data-and-backend/json

https://codeburst.io/quick-tip-how-to-make-http-requests-in-dart-53fc407daf31

ellie-me avatar May 10 '20 22:05 ellie-me

Use Pods Framework plugin to create custom post types and custom fields. It automatically creates all the rest api endpoints for you. Pods is better than ACF if your using this flutter package.

Mayanktaker avatar Sep 15 '20 22:09 Mayanktaker