From 6ce57fbc725088151581f024b4274645d405510f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 16 Feb 2010 17:54:19 +0000 Subject: [PATCH] Add optional post ID arg to get_comments_link(). Props scribu. fixes #12249 git-svn-id: https://develop.svn.wordpress.org/trunk@13171 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index b8781ba347..7a467fb270 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -512,10 +512,11 @@ function get_comment_link( $comment = null, $args = array() ) { * * @since 1.5.0 * + * @param int $post_id Optional post id * @return string The link to the comments */ -function get_comments_link() { - return get_permalink() . '#comments'; +function get_comments_link($post_id = 0) { + return get_permalink($post_id) . '#comments'; } /**