[Solved] Show history of post revisions on front end

Derek Asks: Show history of post revisions on front end
I’m working on an internal knowledgebase and I want to show the post history on the front end (with something like author, date and difference).

I first landed on wp_get_post_revision() (wp_get_post_revision() | Function | WordPress Developer Resources) and after more searching I found wp_list_post_revisions() (wp_list_post_revisions() | Function | WordPress Developer Resources) which looks closer to what I want.

However, while messing with this I’m running into errors while updating posts (Updating failed. The response is not a valid JSON response.) and I don’t see anything on the front end when I return the shortcode. I was hoping there was a plugin for this but since I cannot find one I’m creating a quick one. What am I doing wrong and what’s the best way to accomplish this?

Here is what I’ve tried:

function history_shortcode() {
    //global $wpdb;
    //$revisions = $wpdb->get_results("select * from {$wpdb->posts} where post_parent={$post_id} and post_type='revision'");

    $revisions = wp_list_post_revisions(get_the_ID());
    return $revisions;

add_shortcode( 'history', 'history_shortcode' );

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.