Does anyone know of a way to provide an edit history for posts in production? That is, when people look at a post, they can see that it was modified and examine a list of changes like is possible with other sites (below).

I tried looking for a way but everything I found referred to revision histories in the dashboard, not the public-facing side.


Figure 1: StackExchange

StackExchange edit history function

Figure 2: TV.com

TV.com edit history function

Figure 3: Facebook

Facebook edit history function

2 Answers
2

you can grab revisions from wpdb with smth like

$revisions = $wpdb->get_results("select * from {$wpdb->posts} where post_parent={$post_id} and post_type="revision"")

after selecting a revision you could use some js diff tool like

http://cemerick.github.io/jsdifflib/demo.html

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *