Make WordPress Core


Ignore:
Timestamp:
08/31/2013 01:32:06 AM (11 years ago)
Author:
nacin
Message:

Remove display of 'Previously restored by' in the revisions meta box as it is busted.

Fixes invalid markup (missing closing ul tag) when there was no previously restored revision.

see #25051 for trunk.

File:
1 edited

Legend:

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

    r25026 r25194  
    14291429    echo "<ul class='post-revisions hide-if-no-js'>\n";
    14301430    echo $rows;
    1431 
    1432     // if the post was previously restored from a revision
    1433     // show the restore event details
    1434     if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) {
    1435         $author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] );
    1436         /* translators: revision date format, see http://php.net/date */
    1437         $datef = _x( 'j F, Y @ G:i:s', 'revision date format');
    1438         $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) );
    1439         $time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ;
    1440         ?>
    1441         <hr />
    1442         <div id="revisions-meta-restored">
    1443             <?php
    1444             printf(
    1445                 /* translators: restored revision details: 1: gravatar image, 2: author name, 3: time ago, 4: date */
    1446                 __( 'Previously restored by %1$s %2$s, %3$s ago (%4$s)' ),
    1447                 get_avatar( $author->ID, 24 ),
    1448                 $author->display_name,
    1449                 $time_diff,
    1450                 $date
    1451             );
    1452             ?>
    1453         </div>
    1454         <?php
    1455         echo "</ul>";
    1456     }
    1457 
    1458 }
     1431    echo "</ul>";
     1432}
Note: See TracChangeset for help on using the changeset viewer.