Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
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. –  LOLapalooza Feb 26 '13 at 18:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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