0

In a custom post type, I first got all the revisions using wp_get_post_revisions().

I looped through, and compared metadata and postdata to see the differences between the two. However, it seems that when I employ the same strategy on get_the_terms(), I'm getting the proper taxonomies for the actual published post, but the revisions do not have any taxonomy data.

How can I save taxonomy information for revisions?

1 Answer 1

0

WordPress only supports revisions for post content, not terms.

To create a system that monitors changes in post-term relationships over time, you would have to write a plugin that explicitly handles that.

If you're interested in going down that route, you would probably need to use the save_post hook to save term data (saving as serialized post meta would probably be best) and the add_meta_box hook to output a list of term updates/revisions.

This would be decoupled from the existing revision system unless you wanted to get even more technical, but it might be the most expedient way to get what you want.

1
  • I think I'll do something similar to what you're suggesting. While looking through the core code, it looks like the only thing missing when creating a revision is the call to put terms in the database. I wish there was an action that allowed me to do that manually on wp_is_post_revision. I think I'll go the save_post route and save the terms as metadata. It'll give more flexibility anyway. Thanks. Feb 26, 2013 at 18:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.