Replies: 1 comment
|
Thanks for sharing the examples, @eyalacato! Can you also share which store actions you are dispatching in the WordPress 6.7 also introduced a new action |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@Mamaduka : We spoke briefly about this at the Contributor Day this afternoon and you asked me to create a discussion about this and tag you.
I have a use case where I use the Gutenberg editor for a custom post type and some ACF fields for extra meta data. In the project I'm using the Marketo API to retrieve data for this custom post type. The architecture is as follows:
My workflow is:
acf/save_postaction I'm retrieving data from the Marketo API server-side and I'm storing the data in the database with the update_field function.My question:
Is there a way to let the editor know there are NOT unsaved changes, after finishing my Javascript script that fills the ACF fields with their values. I have tried using dispatch('core/editor').savePost(), however that can create an infinite loop, so that's not the best solution i guess.
Here is a little part of my Javascript code. You said that it's best not to use the "subscribe" function. Can you think with me, what's the best way to achieve my goal?
All reactions