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
This commit is contained in:
Andrew Nacin 2013-03-06 19:57:31 +00:00
parent dded305ec0
commit f994ff39ac
2 changed files with 4 additions and 4 deletions

View File

@ -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() );
}
/**

View File

@ -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() ) );
}
/**