1437 | | <form action="revision.php" method="get"> |
1438 | | |
1439 | | <div class="tablenav"> |
1440 | | <div class="alignleft"> |
1441 | | <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Compare Revisions' ); ?>" /> |
1442 | | <input type="hidden" name="action" value="diff" /> |
1443 | | <input type="hidden" name="post_type" value="<?php echo esc_attr($post->post_type); ?>" /> |
1444 | | </div> |
1445 | | </div> |
1446 | | |
1447 | | <br class="clear" /> |
1448 | | |
1449 | | <table class="widefat post-revisions" cellspacing="0" id="post-revisions"> |
1450 | | <col /> |
1451 | | <col /> |
1452 | | <col style="width: 33%" /> |
1453 | | <col style="width: 33%" /> |
1454 | | <col style="width: 33%" /> |
1455 | | <thead> |
1456 | | <tr> |
1457 | | <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Old', 'revisions column name' ); ?></th> |
1458 | | <th scope="col"><?php /* translators: column name in revisions */ _ex( 'New', 'revisions column name' ); ?></th> |
1459 | | <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Date Created', 'revisions column name' ); ?></th> |
1460 | | <th scope="col"><?php _e( 'Author' ); ?></th> |
1461 | | <th scope="col" class="action-links"><?php _e( 'Actions' ); ?></th> |
1462 | | </tr> |
1463 | | </thead> |
1464 | | <tbody> |
1465 | | |
1466 | | <?php echo $rows; ?> |
1467 | | |
1468 | | </tbody> |
1469 | | </table> |
1470 | | |
1471 | | </form> |
1472 | | |
1473 | | <?php |
1474 | | else : |
1475 | | echo "<ul class='post-revisions'>\n"; |
1476 | | echo $rows; |
1477 | | |
1478 | | // if the post was previously restored from a revision |
1479 | | // show the restore event details |
1480 | | if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) { |
1481 | | $author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] ); |
1482 | | /* translators: revision date format, see http://php.net/date */ |
1483 | | $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); |
1484 | | $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) ); |
1485 | | $time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ; |
| 1439 | // if the post was previously restored from a revision |
| 1440 | // show the restore event details |
| 1441 | if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) { |
| 1442 | $author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] ); |
| 1443 | /* translators: revision date format, see http://php.net/date */ |
| 1444 | $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); |
| 1445 | $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) ); |
| 1446 | $time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ; |
| 1447 | ?> |
| 1448 | <hr /> |
| 1449 | <div id="revisions-meta-restored"> |
| 1450 | <?php |
| 1451 | printf( |
| 1452 | /* translators: restored revision details: 1: gravatar image, 2: author name, 3: time ago, 4: date */ |
| 1453 | __( 'Previously restored by %1$s %2$s, %3$s ago (%4$s)' ), |
| 1454 | get_avatar( $author->ID, 24 ), |
| 1455 | $author->display_name, |
| 1456 | $time_diff, |
| 1457 | $date |
| 1458 | ); |