Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are Terms saved after wp_insert_post-Hook with Gutenberg? #3898

Closed
carstenwawer opened this issue Dec 10, 2017 · 2 comments
Closed

Are Terms saved after wp_insert_post-Hook with Gutenberg? #3898

carstenwawer opened this issue Dec 10, 2017 · 2 comments
Labels
Core REST API Task Task for Core REST API efforts

Comments

@carstenwawer
Copy link

Issue Overview

Hi,

we are managing a Wordpress-Multisite-Network, thats publishes new and updated Posts into an external API. We are using the wp_insert_post-Hook to get all the data and publish it to the API.

With the classic Editor, when wp_insert_post is called, all Term-Data is saved and a call of wp_get_post_terms gets me the data.

With the current Gutenberg on the Beta-Wordpress-Nightly-Build, this Behaviour seems to have changed. When the wp_insert_post is called the Term-Data is not available, but if you save the post again, it is.

I suspect the that the saving of Terms moved to a later Point in Gutenberg. Is that right?

So my questions are:

Is this expected behaviour?
Is there a way to hook into the end of gutenberg-save-process when all Data is saved?

@pento pento added the Core REST API Task Task for Core REST API efforts label Dec 11, 2017
@pento pento modified the milestone: Needs API Dec 11, 2017
@pento
Copy link
Member

pento commented Dec 11, 2017

Thank you for the issue, @carstenwawer! This is caused by the REST API updating posts slightly differently to how the current post editor updates them.

Unfortunately, there currently isn't an action triggered after all post data has been saved via the REST API, I've opened a Core ticket to get one added in.

@danielbachhuber danielbachhuber added this to the Core API milestone Apr 11, 2018
@danielbachhuber
Copy link
Member

Closing in favor of the Core ticket, which is filed against WordPress 5.0. No action needed within Gutenberg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts
Projects
None yet
Development

No branches or pull requests

3 participants