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

See #33638.

Built from https://develop.svn.wordpress.org/trunk@34042


git-svn-id: http://core.svn.wordpress.org/trunk@34010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2015-09-11 06:21:25 +00:00
parent c3f642bea9
commit db4f22bfb5
8 changed files with 12 additions and 12 deletions

View File

@@ -229,7 +229,7 @@ class Walker_Comment extends Walker {
?>
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
<div class="comment-body">
<?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
<?php _e( 'Pingback:' ); ?> <?php comment_author_link( $comment ); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
</div>
<?php
}
@@ -268,7 +268,7 @@ class Walker_Comment extends Walker {
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>">
<?php
/* translators: 1: comment date, 2: comment time */
printf( __( '%1$s at %2$s' ), get_comment_date( '', $comment ), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)' ), '&nbsp;&nbsp;', '' );
@@ -317,7 +317,7 @@ class Walker_Comment extends Walker {
</div><!-- .comment-author -->
<div class="comment-metadata">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
<a href="<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>">
<time datetime="<?php comment_time( 'c' ); ?>">
<?php
/* translators: 1: comment date, 2: comment time */

View File

@@ -1285,7 +1285,7 @@ function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false
*
* @since 2.3.0
*
* @param int $comment_id Optional. Comment ID.
* @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.
* @return string|void The edit comment link URL for the given comment.
*/
function get_edit_comment_link( $comment_id = 0 ) {
@@ -1326,7 +1326,7 @@ function edit_comment_link( $text = null, $before = '', $after = '' ) {
$text = __( 'Edit This' );
}
$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '">' . $text . '</a>';
$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment ) . '">' . $text . '</a>';
/**
* Filter the comment edit link anchor tag.

View File

@@ -1472,7 +1472,7 @@ function wp_notify_postauthor( $comment_id, $deprecated = null ) {
break;
}
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
$notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment_id ) ) . "\r\n";
$notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment ) ) . "\r\n";
if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) {
if ( EMPTY_TRASH_DAYS )

View File

@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34041';
$wp_version = '4.4-alpha-34042';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@@ -111,7 +111,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
/* translators: comments widget: 1: comment author, 2: post link */
$output .= sprintf( _x( '%1$s on %2$s', 'widgets' ),
'<span class="comment-author-link">' . get_comment_author_link( $comment ) . '</span>',
'<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
'<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
);
$output .= '</li>';
}