WordPress.org

Make WordPress Core

Changeset 34039


Ignore:
Timestamp:
09/11/2015 06:04:22 AM (6 years ago)
Author:
wonderboymusic
Message:

After [33961], pass $comment to get_comment_author_link() where possible to avoid extra cache/db lookups.

See #33638.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/comment.php

    r34019 r34039  
    181181        if ( $comment->comment_parent ) {
    182182            $parent      = get_comment( $comment->comment_parent );
    183             $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
    184             $name        = get_comment_author( $parent->comment_ID );
     183            $parent_link = esc_url( get_comment_link( $parent ) );
     184            $name        = get_comment_author( $parent );
    185185            printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
    186186        }
  • trunk/src/wp-admin/edit-form-comment.php

    r34015 r34039  
    122122    if ( $parent ) :
    123123        $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
    124         $name        = get_comment_author( $parent->comment_ID );
     124        $name        = get_comment_author( $parent );
    125125    ?>
    126126    <div class="misc-pub-section misc-pub-reply-to">
  • trunk/src/wp-includes/class-walker-comment.php

    r33962 r34039  
    262262        <div class="comment-author vcard">
    263263            <?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
    264             <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>' ), get_comment_author_link() ); ?>
     264            <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>' ), get_comment_author_link( $comment ) ); ?>
    265265        </div>
    266266        <?php if ( '0' == $comment->comment_approved ) : ?>
     
    314314                    <div class="comment-author vcard">
    315315                        <?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
    316                         <?php printf( __( '%s <span class="says">says:</span>' ), sprintf( '<b class="fn">%s</b>', get_comment_author_link() ) ); ?>
     316                        <?php printf( __( '%s <span class="says">says:</span>' ), sprintf( '<b class="fn">%s</b>', get_comment_author_link( $comment ) ) ); ?>
    317317                    </div><!-- .comment-author -->
    318318
  • trunk/src/wp-includes/comment-template.php

    r34008 r34039  
    16731673    else {
    16741674        $comment = get_comment($replytoid);
    1675         $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
     1675        $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' : get_comment_author( $comment );
    16761676        printf( $replytext, $author );
    16771677    }
  • trunk/src/wp-includes/theme-compat/comments-popup.php

    r33774 r34039  
    5353    <li id="comment-<?php comment_ID() ?>">
    5454    <?php comment_text() ?>
    55     <p><cite><?php comment_type(); ?> <?php printf(__('by %1$s &#8212; %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>
     55    <p><cite><?php comment_type(); ?> <?php printf(__('by %1$s &#8212; %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link( $comment ), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>
    5656    </li>
    5757
  • trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php

    r33954 r34039  
    111111                /* translators: comments widget: 1: comment author, 2: post link */
    112112                $output .= sprintf( _x( '%1$s on %2$s', 'widgets' ),
    113                     '<span class="comment-author-link">' . get_comment_author_link( $comment->comment_ID ) . '</span>',
     113                    '<span class="comment-author-link">' . get_comment_author_link( $comment ) . '</span>',
    114114                    '<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
    115115                );
Note: See TracChangeset for help on using the changeset viewer.