CartMetrix - Do you know yours?

« ZenCart Inventory Report - Updated | Home | Quick and Dirty MySQL Backup Script »

3/12/2007

Wordpress Revision History Plugin

Editing a post is a necessity from time to time, especially with any type of coding related blog. I particularly like to keep older posts up to date with revised download links as new versions are released. This prevents a user following a link off of a search engine to an old post and downloading an old version of one of my pieces of code. Surprisingly, I could not find a Wordpress plugin to do just this. This tiny plugin allows you to attach timestamped revision tags to a post using the Wordpress metadata system.

For an example in action see the Post History heading after this post.

Installation

  1. Download and unzip wp_revision_history.zip
  2. Upload revision_history.php to your Wordpress wp-content/plugins/ directory.
  3. Add the following CSS to your stylesheet. Change CSS to match your site layout.
    #revision-date  {
            padding: 3px 5px 3px 12px;
            font-weight: bold;
            color: #333;
    }

    #revision       {
            padding: 2px 5px 8px 18px;
            color: #555;

    }

  4. Add the following snippet to your template where you want a post's revision
    history to display

    <?php if(function_exists('wp_has_history') && wp_has_history())   {  ?>
    <h3>Post History</h3>
    <div class="cmeta" style="bottom-margin: 20px;" id="history">
    <?php wp_history(); ?> 
    </div>
    <? } ?>

Usage

To add a revision tag to a post, add a new custom field named 'history' to the post. Set the custom field's value to the revision note text. Multiple revision tags may be made to the same post by adding more custom fields with the key 'history'. Each note will be automatically timestamped. The history listing will be sorted by the timestamp value.

Download Wordpress Revision History

Popularity: 25%

Trackback:

Post History

2006-12-03 08:12
First revision
2006-12-03 08:12
Second revision

Related Posts

5 Responses to “Wordpress Revision History Plugin”

  1. Endolith said:

    Does it actually save each revision, or just update the page with a list of when you changed it? I want an extension or plugin that saves each revision of a posting that I create. I’ve been using Google Documents to do it, but that’s less than optimal…

  2. damonp said:

    No this does not track the actual text of different versions of a post. It only allows you to timestamp and comment any changes to a post.

  3. tristan said:

    I think you should save the diff file (the difference between the current and the previous file in the database) so we can revert it to an older version, just like wikis. What do you think?

    I was supposed to look at that plugin when google directs me here. Typing in keyword “wordpress revision plugin”.

    Do you know anything like this? Thanks in advance.

  4. Endolith said:

    See http://urbangiraffe.com/plugins/audit-trail/ for a plugin that keeps each revision.

  5. tristan said:

    thanks :)

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It