WordPress Plugin: Recent Changes

As WordPress comes of age as a powerful CMS and Bliki the ability to see recently changed items has become an important feature.

This plugin adds a widget to your sidebar that allows you to:

  • set a title for your list of recent items in the side bar
  • choose recently changed posts, pages or both
  • select 1-15 most recently modified items in your sidebar
  • exclude multiple pages or posts by ID

I have added a shortcode to the plugin so you can add a list of recent changes to any page or post.

[recentchanges] will add a list of the 5 most recently changed pages and posts. You can set the following parameters to modify the results:

content = ‘pages’, ‘posts’ or ‘both
number = ’1′ to ’15′
exclude = any number of pages/post by ID separated by commas

e.g. [recentchanges content='pages' number='10' exclude='5,8'] would generate:

You can add the function to a theme with default parameters by adding the following code:

<?php
echo SC_RecentChanges($atts)
?>

Or with custom parameters by adding and altering the following code:

<?php
$atts = array('number' => '10', 'content' => 'pages');
echo SC_RecentChanges($atts)
?>

NB all functionality of my WordPress Widget: Recent Pages has been incorporated into this new widget.

Download Recent Changes and please leave a comment if you have feature requests and/or issues.

If you find this plug in useful please consider donating to its future development:

30 Comments

  1. baron says:

    Works great, thank you

  2. Alex says:

    Works great thanks – but just needs a small adjustment to be valid XHTML

    line 43
    echo ‘‘.$RecentChange->post_title.’‘;

    The href= needs double quotes to start and end around the $rc_url

    Otherwise the W3C validator throws up about 40 errors

  3. Toni Prug says:

    Hi Titus, great plugin, exactly what i was looking for. I added couple of features to it, you can see screnshoots at:

    http://hackthestate.org/wp-dev/plugin-recent-changes/

    i’d like to send you the source code with new features, but i can’t find your email on this blog nor in readme.txt file.

  4. Ken harper says:

    Hello there,

    First, thx a ton for the work.

    I’m a bit new to theme development and have my first theme all working but can’t seem to get any line breaks after each in your widget. I know it it must be something simple I’m missing, can you point me in a good direction?

    Thx for you time.

    k

  5. Abikesha says:

    Hi all,
    Can you help me, how to exclude view some pages that i would change.

    If in Recenpost i can write this :
    Recent_Posts(exclude=249) ===> it can work

    How i must write for Recent Changes plugin because i write :
    widget_RecentChanges(array ()&exclude=2) ===> doesn’t work.

    please help me!

  6. Arnout says:

    Works fine, but had to change the database query. You should replace wp_posts with “.$wpdb->posts.” and add the ‘global $wpdb;’ statement above it. This fixes the cases where wordpress installations use a prefix for their databases.

  7. Mat says:

    Thanks for the plugin, I like it but had to make the change from Arnout in order for it to work for me.

  8. titusbicknell says:

    Sorry for the delay in addressing your comments. I have issued a 0.2 release today that includes:
    - Alex’s W3C validation fix
    - Arnout’s $wpdb->posts fix

    Ken: can you sned me a link to your install showing the plug in without line breaks?
    Abikesha: I do not have an easy solution for you as my plug in is not based on the Recent Pages core code.

  9. ultor says:

    I am getting incorrect rc_url for posts but fine for pages.

    I had to change get_page_link to get_permalink to work for me.

  10. Greeny says:

    I wont to know why text widget code, give errors on validation w3c.How can we fix that.Thank you

  11. titusbicknell says:

    Can you send me the link for a page with the Recent Changes plug in active so I can see what errors W3C identifies?

  12. Cosmin Manci says:

    Dear Titus Bicknell,

    found your great wordpress plugin “Recent Changes”. Works great with pages (what I needed) but, I hope i’m not bothering you too much with this questions, is possible that a function to be added?
    I have a series of pages (what is new: – >>> http://plants.nature4stock.com/ )and when updating them I’m not interested this to be shown as changed… so it is possible to add some ID of pages that I want to hide there. Something like in the original “Pages” widget from wordpress (exclude function).

    Thank you very much and have a nice day,
    cosmln

  13. titusbicknell says:

    I have had several requests for this feature and it will be included in the next release together with a short code option for inclusion in page/posts.

  14. titusbicknell says:

    new version includes ability to exclude by ID and a shortcode for use in pages and posts.

  15. titusbicknell says:

    new version includes ability to exclude by ID and a shortcode for use in pages and posts http://www.titusbicknell.com/wordpress/wp-recent-changes

  16. I think it would be a good idea to optionally show the date along the post and pages.

  17. Cosmin Manci says:

    Thank you,
    cosmln

  18. Kelvin Jones says:

    I upgraded your plugin and it does not work. What apppeared on the website was not intelligablle so I deactivated it. I had been using the recent pages choice but an old version of your plug-in and that had been working and I liked it.

  19. Josh S says:

    Hi,
    Im trying to add this widget to my home page so it will show the 3 most recent pages from my articles directory. I found the code to load wp functions:
    define(‘WP_USE_THEMES’, false);
    require(‘./articles/wp-load.php’);

    but what php would I need in my sidebar to make the widget appear on my home page. If you can help me it would be greatly appreciated.

    Thanks,
    Josh

  20. titusbicknell says:

    Josh: under appearance -> widgets you can activate and configure Recent Changes so that it appears in your widgetised sidebar.

  21. Mike says:

    Hello & thank you for the great plugin!

    Is there documentation anywhere on how to include a call to Recent Changes within a template (rather than only as a widget)?

    Thanks again!

  22. titusbicknell says:

    Mike: a very good question that I have answered in the plugin description above.

    Yours

    Titus

  23. Pat J says:

    The recent-changes-inc.php uses “<?" instead of "<?php" in line 1. You might want to change this — not everyone allows short tags.

  24. naranhai says:

    Thank you for great plugin!

    Any chance to include not only titles but a pic and a small portion of the changed post/page? And maybe put them in two columns? Thank you!

  25. Jill Chongva says:

    Is there a way to show the date the post/page was updated?

  26. Echio says:

    How come it display newly added post as well?

  27. Emily says:

    I’ve implemented this on my site and really need it to display the date and possibly the time the page or post was updated. Is this possible?

  28. Kaden says:

    Hello and thanks for this nice plugin!

    Like Emily above me, I would like to display the date when the article/page has been updated. Thanks!

  29. Kaden says:

    Oh, and one more thing would be nice:
    The option to add a reason, like “spelling”, “adding content” etc.

    Thanks!

Leave a Reply