Changeset 24708
- Timestamp:
- 07/15/2013 11:01:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/revision.php
r24671 r24708 64 64 function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) { 65 65 $post = get_post( $post ); 66 $revisions = array();66 $revisions = $authors = array(); 67 67 $now_gmt = time(); 68 68 69 69 $revisions = wp_get_post_revisions( $post->ID, array( 'order' => 'ASC' ) ); 70 $show_avatars = get_option( 'show_avatars' ); 70 71 71 72 cache_users( wp_list_pluck( $revisions, 'post_author' ) ); … … 82 83 "restore-post_{$revision->ID}" 83 84 ); 85 86 if ( ! isset( $authors[ $revision->post_author ] ) ) { 87 $authors[ $revision->post_author ] = array( 88 'id' => (int) $revision->post_author, 89 'avatar' => $show_avatars ? get_avatar( $revision->post_author, 24 ) : '', 90 'name' => get_the_author_meta( 'display_name', $revision->post_author ), 91 ); 92 } 93 84 94 $revisions[ $revision->ID ] = array( 85 'id' => $revision->ID, 86 'title' => get_the_title( $post->ID ), 87 'author' => array( 88 'id' => (int) $revision->post_author, 89 'avatar' => get_avatar( $revision->post_author, 24 ), 90 'name' => get_the_author_meta( 'display_name', $revision->post_author ), 91 ), 92 'date' => date_i18n( __( 'M j, Y @ G:i' ), $modified ), 93 'dateShort' => date_i18n( _x( 'j M @ G:i', 'revision date short format' ), $modified ), 94 'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ), 95 'autosave' => wp_is_post_autosave( $revision ), 96 'current' => $revision->post_modified_gmt === $post->post_modified_gmt, 97 'restoreUrl' => urldecode( $restore_link ), 95 'id' => $revision->ID, 96 'title' => get_the_title( $post->ID ), 97 'author' => $authors[ $revision->post_author ], 98 'date' => date_i18n( __( 'M j, Y @ G:i' ), $modified ), 99 'dateShort' => date_i18n( _x( 'j M @ G:i', 'revision date short format' ), $modified ), 100 'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ), 101 'autosave' => wp_is_post_autosave( $revision ), 102 'current' => $revision->post_modified_gmt === $post->post_modified_gmt, 103 'restoreUrl' => urldecode( $restore_link ), 98 104 ); 99 105 }
Note: See TracChangeset
for help on using the changeset viewer.