From f994ff39acd698766d9d46b43fb01decc5d1668e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 6 Mar 2013 19:57:31 +0000 Subject: [PATCH] Add filters to comments_link_feed(), comment_link(), and get_comments_link(). esc_url() the echoed output of comments_link(). props MarcusPope. fixes #19210. git-svn-id: http://core.svn.wordpress.org/trunk@23624 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 4 ++-- wp-includes/feed.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 8be25e10d5..0569a75862 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -516,7 +516,7 @@ function get_comment_link( $comment = null, $args = array() ) { * @return string The link to the comments */ function get_comments_link($post_id = 0) { - return get_permalink($post_id) . '#comments'; + return apply_filters( 'get_comments_link', get_permalink( $post_id ) . '#comments', $post_id ); } /** @@ -532,7 +532,7 @@ function comments_link( $deprecated = '', $deprecated_2 = '' ) { _deprecated_argument( __FUNCTION__, '0.72' ); if ( !empty( $deprecated_2 ) ) _deprecated_argument( __FUNCTION__, '1.3' ); - echo get_comments_link(); + echo esc_url( get_comments_link() ); } /** diff --git a/wp-includes/feed.php b/wp-includes/feed.php index c0b2440825..76b9bbb2cd 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -198,7 +198,7 @@ function the_permalink_rss() { * @return none */ function comments_link_feed() { - echo esc_url( get_comments_link() ); + echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); } /** @@ -239,7 +239,7 @@ function get_comment_guid($comment_id = null) { * @since 1.5.0 */ function comment_link() { - echo esc_url( get_comment_link() ); + echo esc_url( apply_filters( 'comment_link', get_comment_link() ) ); } /**