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

post_updated returns old term values #15777

Open
heggemsnes opened this issue May 22, 2019 · 2 comments
Open

post_updated returns old term values #15777

heggemsnes opened this issue May 22, 2019 · 2 comments

Comments

@heggemsnes
Copy link

@heggemsnes heggemsnes commented May 22, 2019

When using post_updated or save_post hook with Gutenberg editor activated the data received inside the hook is data from before the update. It works when classic editor is in use.

Steps to reproduce the behavior:
Create a function to hook into post_updated and try to get a term. See my example:

dd_action('post_updated', 'taxtometa', 10, 3);
function taxtometa($post_ID, $post_after, $post_before){
$terms = get_the_terms($post_ID, 'country');
error_log($terms[0]->name);
}

With Gutenberg activated it returns the "old" name of the term. If you do a "blank update" afterwards it returns the correct name.

Trying the same in with the old editor works fine.

Running 5.2.1 with MAMP 5.2.

@florianbrinkmann

This comment has been minimized.

Copy link

@florianbrinkmann florianbrinkmann commented Jul 10, 2019

I have the same issue using the {$new_status}_{$post->post_type} filter.

@florianbrinkmann

This comment has been minimized.

Copy link

@florianbrinkmann florianbrinkmann commented Jul 10, 2019

The same issue seems to occur for the set_object_terms hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.