Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Created June 14, 2016 01:54
Show Gist options
  • Save joelstransky/d7445f27ddc79b9a426d5aca80c13bb2 to your computer and use it in GitHub Desktop.
Save joelstransky/d7445f27ddc79b9a426d5aca80c13bb2 to your computer and use it in GitHub Desktop.
// this just prints the modified date of the published post for each revision
<?php
$args = array(
'offset' => 1,
'numberposts' => PHP_INT_MAX,
);
$revisions = wp_get_post_revisions( get_the_id(), $args );
foreach ($revisions as $revision) {
setup_postdata( $revision );
?>
<p>Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?></p>
<?php
}
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment