0

I'm creating a plugin and I have added a custom settings panel in the editor sidebar. In my settings panel I have a couple of text inputs and a custom button that calls an endpoint to pass some data to my php using @wordpress/api-fetch. When the post is updated, the values of the fields are populated in custom post metas, but the problem is that if I change the inputs, the post meta is not updated until I manually update the post and therefore when I pass my data to the endpoint, my php gets the previous field values.. Is there a way to force post update before the call to the endpoint when that custom button is clicked?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.