Make WordPress Core

Ticket #24084: 24084.patch

File 24084.patch, 2.7 KB (added by azaozz, 12 years ago)
  • wp-admin/edit-form-advanced.php

     
    463463        <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
    464464        <td class="autosave-info">
    465465        <span class="autosave-message">&nbsp;</span>
    466 <?php
     466        <span id="last-edit">
     467        <?php
     468
    467469        if ( 'auto-draft' != $post->post_status ) {
    468                 echo '<span id="last-edit">';
    469                 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
    470                         $last_user = get_userdata($last_id);
    471                         printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    472                 } else {
    473                         printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    474                 }
    475                 echo '</span>';
    476         } ?>
     470                if ( ( $last_id = get_post_meta( $post_ID, '_edit_last', true ) ) && ( $last_user = get_userdata( $last_id ) ) )
     471                        printf( __('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date( get_option('date_format'), $post->post_modified ), mysql2date( get_option('time_format'), $post->post_modified ) );
     472                else
     473                        printf( __('Last edited on %1$s at %2$s'), mysql2date( get_option('date_format'), $post->post_modified ), mysql2date( get_option('time_format'), $post->post_modified ) );
     474        }
     475
     476        ?>
     477        </span>
    477478        </td>
    478479</tr></tbody></table>
    479480
    480481</div>
    481 <?php }
     482<?php
     483}
    482484
    483485if ( has_action( 'edit_form_after_editor' ) ) {
    484486        echo '<div class="edit-form-section">';
    485487        do_action( 'edit_form_after_editor' );
    486488        echo '</div>';
    487489}
     490
    488491?>
    489492</div><!-- /post-body-content -->
    490493
  • wp-includes/comment-template.php

     
    2222 */
    2323function get_comment_author( $comment_ID = 0 ) {
    2424        $comment = get_comment( $comment_ID );
    25         if ( empty($comment->comment_author) ) {
    26                 if (!empty($comment->user_id)){
    27                         $user=get_userdata($comment->user_id);
    28                         $author=$user->user_login;
    29                 } else {
     25
     26        if ( empty( $comment->comment_author ) ) {
     27                if ( ! empty( $comment->user_id ) && ( $user = get_userdata( $comment->user_id ) ) )
     28                        $author = $user->display_name;
     29                else
    3030                        $author = __('Anonymous');
    31                 }
    3231        } else {
    3332                $author = $comment->comment_author;
    3433        }
    35         return apply_filters('get_comment_author', $author);
     34
     35        return apply_filters( 'get_comment_author', $author );
    3636}
    3737
    3838/**