Home Forums ACF PRO Add offline functionality


Add offline functionality

  • Hey guys,

    I’m currently facing a rather unique issue with a client request.

    We’ve built a small wordpress website for our client to log parking violations in various car parks. So far we’re using Gravity Forms to have the employees submit entries and edit them afterwards.

    No the client wants the whole thing to work while offline, since there’s not always good connection in the car parks.

    That’s where the problems start. I was able to setup a pwa on wordpress and check the online status. If we’re offline, I’m saving the entry data to local storage and as soon as we’re back online we’re sending the data via gravity forms rest api.

    The gravity forms api however can’t process images, which we desperately need. So my solution is switching to ACF with front end submission pro plugin to easily create the form and be able to edit entries.

    Since ACF is so complex however, I’m kind of stuck on the workflow of checking the connection status and if offline, save the data to local storage and send it once back online.

    The idea is: hook into acf/save_post and check connection status using the running pwa plugin. If offline, save $_POST contents to local storage and stop form submission by returning null. Once back online, read load $_POST from local storage and run acf/save_post again.

    My issue with that: I wasn’t able to fully track image submission in acf and all the other things going on when submitting. In Gravity Forms, I simply wrote the whole thing in javascript, but here using the action hook I need to switch to php.

    So I guess my question is: Has anyone here realized something similar or has any insight/tipps on how to implement this for multiple form submissions while being offline and submitting all data once the connection is reestablished?

    Thanks guys!

  • All I can really do is point you to the JS API docs

    There is an action that can be added to alter the submit action. This discussion might be of interest to you

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Add offline functionality’ is closed to new replies.