From db4f22bfb591bf161d54e237f45edb3fac2d6f0b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 11 Sep 2015 06:21:25 +0000 Subject: [PATCH] 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 --- wp-admin/comment.php | 2 +- wp-admin/edit-form-comment.php | 4 ++-- wp-comments-post.php | 2 +- wp-includes/class-walker-comment.php | 6 +++--- wp-includes/link-template.php | 4 ++-- wp-includes/pluggable.php | 2 +- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-recent-comments.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 24b0e16e40..6d11e553ff 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -193,7 +193,7 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved %2$s at %3$s' ), - esc_url( get_comment_link( $comment->comment_ID ) ), + esc_url( get_comment_link( $comment ) ), /* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ), $comment ), get_comment_date( get_option( 'time_format' ), $comment ) diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index fe49043927..426d86db40 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -69,7 +69,7 @@ if ( !defined('ABSPATH') )
- +
@@ -120,7 +120,7 @@ if ( current_user_can( 'edit_post', $post_id ) ) { if ( $comment->comment_parent ) : $parent = get_comment( $comment->comment_parent ); if ( $parent ) : - $parent_link = esc_url( get_comment_link( $comment->comment_parent ) ); + $parent_link = esc_url( get_comment_link( $comment ) ); $name = get_comment_author( $parent ); ?>
diff --git a/wp-comments-post.php b/wp-comments-post.php index fd4ca47ce9..44eab61d1c 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -151,7 +151,7 @@ $comment = get_comment( $comment_id ); */ do_action( 'set_comment_cookies', $comment, $user ); -$location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id; +$location = empty($_POST['redirect_to']) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment_id; /** * Filter the location URI to send the commenter after posting. diff --git a/wp-includes/class-walker-comment.php b/wp-includes/class-walker-comment.php index 75d5e466c3..e0150b34fe 100644 --- a/wp-includes/class-walker-comment.php +++ b/wp-includes/class-walker-comment.php @@ -229,7 +229,7 @@ class Walker_Comment extends Walker { ?> < id="comment-" >
- ', '' ); ?> + ', '' ); ?>
-