Make WordPress Core


Ignore:
Timestamp:
02/28/2013 03:14:34 PM (12 years ago)
Author:
westi
Message:

Revisions: First pass an implementing a new UI/UX for reviewing the revisions of posts. See #23497 props adamsilverstein for the initial patch.

This implements a new revisions ui using Backbone and preserves all the old methods of "integration" so the change should be transparent to plugins using revisi
ons with CPTs.

This is the first pass and so there are a number of things still to be resolved, more details in the ticket. Feedback welcomed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r23416 r23506  
    13011301        return false;
    13021302
     1303    $author = get_the_author_meta( 'display_name', $revision->post_author );
    13031304    /* translators: revision date format, see http://php.net/date */
    1304     $datef = _x( 'j F, Y @ G:i', 'revision date format');
    1305     /* translators: 1: date */
    1306     $autosavef = __( '%1$s [Autosave]' );
    1307     /* translators: 1: date */
    1308     $currentf  = __( '%1$s [Current Revision]' );
     1305    $datef = _x( 'j F, Y @ G:i:s', 'revision date format');
     1306
     1307    $gravatar = get_avatar( $revision->post_author, 18 );
    13091308
    13101309    $date = date_i18n( $datef, strtotime( $revision->post_modified ) );
    13111310    if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
    13121311        $date = "<a href='$link'>$date</a>";
     1312   
     1313    $revision_date_author = sprintf(
     1314        '%s %s, %s %s (%s)',
     1315        $gravatar,
     1316        $author,
     1317        human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ),
     1318        __( 'ago' ),
     1319        $date
     1320    );
     1321
     1322    $autosavef = __( '%1$s [Autosave]' );
     1323    $currentf  = __( '%1$s [Current Revision]' );
    13131324
    13141325    if ( !wp_is_post_revision( $revision ) )
    1315         $date = sprintf( $currentf, $date );
     1326        $revision_date_author = sprintf( $currentf, $revision_date_author );
    13161327    elseif ( wp_is_post_autosave( $revision ) )
    1317         $date = sprintf( $autosavef, $date );
    1318 
    1319     return $date;
     1328        $revision_date_author = sprintf( $autosavef, $revision_date_author );
     1329
     1330    return $revision_date_author;
    13201331}
    13211332
Note: See TracChangeset for help on using the changeset viewer.