• Resolved ltrain

    (@ltrain)


    Hello,

    I’m trying to figure out a way to display the date and time that post or page was last updated.

    I’ve got code to display the date and time a page was published, and code to display how long ago that is. but is there any way to get the date and time (or how long ago) of the latest revision?

Viewing 1 replies (of 1 total)
  • Thread Starter ltrain

    (@ltrain)

    i’m thinking this might get me somewhere

    <?php
    	if ($post_ID) {
    		if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
    			$last_user = get_userdata($last_id);
    			printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    		} else {
    			printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    		}
    	}
    ?>

    but i don’t know what to change or where to go from there.

Viewing 1 replies (of 1 total)
  • The topic ‘Get revision time and date’ is closed to new replies.