Index: trunk/wp-includes/post-template.php =================================================================== --- trunk/wp-includes/post-template.php (revision 23743) +++ trunk/wp-includes/post-template.php (revision 23769) @@ -1307,9 +1307,48 @@ return false; + /* translators: revision date format, see http://php.net/date */ + $datef = _x( 'j F, Y @ G:i', 'revision date format'); + /* translators: 1: date */ + $autosavef = __( '%1$s [Autosave]' ); + /* translators: 1: date */ + $currentf = __( '%1$s [Current Revision]' ); + + $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); + if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) + $date = "$date"; + + if ( !wp_is_post_revision( $revision ) ) + $date = sprintf( $currentf, $date ); + elseif ( wp_is_post_autosave( $revision ) ) + $date = sprintf( $autosavef, $date ); + + return $date; +} + +/** + * Retrieve formatted date timestamp of a revision (linked to that revisions's page). + * + * @package WordPress + * @subpackage Post_Revisions + * @since 3.6.0 + * + * @uses date_i18n() + * + * @param int|object $revision Revision ID or revision object. + * @param bool $link Optional, default is true. Link to revisions's page? + * @return string gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'. + */ +function wp_post_revision_title_expanded( $revision, $link = true ) { + if ( !$revision = get_post( $revision ) ) + return $revision; + + if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) + return false; + $author = get_the_author_meta( 'display_name', $revision->post_author ); /* translators: revision date format, see http://php.net/date */ $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); - $gravatar = get_avatar( $revision->post_author, 18 ); + $gravatar = get_avatar( $revision->post_author, 24 ); $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); @@ -1389,8 +1428,15 @@ /* translators: post revision: 1: when, 2: author name */ - $titlef = _x( '%1$s by %2$s', 'post revision' ); + $titlef = _x( '%1$s', 'post revision' ); if ( $parent ) array_unshift( $revisions, $post ); + + // since 3.6 revisions include a copy of the current post data as a revision + // the collowing removes this current revision if present from the list of + // revisions returned by wp_list_post_revisions, remove these to include the + // crrent post revision in the list of revisions + if ( wp_first_revision_matches_current_version( $post_id ) ) + array_pop( $revisions ); $rows = $right_checked = ''; @@ -1403,32 +1449,9 @@ continue; - $date = wp_post_revision_title( $revision ); - $name = get_the_author_meta( 'display_name', $revision->post_author ); - - if ( 'form-table' == $format ) { - if ( $left ) - $left_checked = $left == $revision->ID ? ' checked="checked"' : ''; - else - $left_checked = $right_checked ? ' checked="checked"' : ''; // [sic] (the next one) - $right_checked = $right == $revision->ID ? ' checked="checked"' : ''; - - $class = $class ? '' : " class='alternate'"; - - if ( $post->ID != $revision->ID && $can_edit_post ) - $actions = 'ID|$revision->ID" ) . '">' . __( 'Restore' ) . ''; - else - $actions = ''; - - $rows .= "