With the latest version of WordPress, how can we publish revisions of a post, in addition to showing the latest post?
I want my front end users to see multiple versions of the same post. The same post is going to change “some” of its content every friday. All weekly versions will then be compared by non-administrators (ie managers and directors) at some point every month.
My goal is to make it as easy as possible for a public user to review revisions.
There doesn’t appear to be a plugin concept for this. Can I modify the internal revisions tool to accomplish something like this?
Many thanks!
I suggest you look at https://codex.wordpress.org/Function_Reference/wp_get_post_revisions
<?php
// Lets get the revisions of the given $post we are accessing by ID ( you are probably going to want to limit your internal revision count for this
$revisions = wp_get_post_revisions($post->ID);
// lets just do some formatting here ( your post html content is going to display normally but lets get the var_dump to look decent
echo '<pre>';
// print the $revisions variable to look at the internals
var_dump($revisions);
echo '</pre>';
// from here i would dig into iterating over the revisions array.
?>
using the above code inside your loop should get your started to see what kind of data you can return from wp_get_post_revisions(). You are going to need to do some searching on the post_date portion or look at the array key and sort by the integer and push to a custom array where key matches count() to return only the most recent post revision. This query will be huge so i sincerely suggest you limit your wordpress installs revision count.