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: https://develop.svn.wordpress.org/trunk@23624 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-03-06 19:57:31 +00:00
parent 5fdeae8ffd
commit 11b772ea05
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 * @return string The link to the comments
*/ */
function get_comments_link($post_id = 0) { 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' ); _deprecated_argument( __FUNCTION__, '0.72' );
if ( !empty( $deprecated_2 ) ) if ( !empty( $deprecated_2 ) )
_deprecated_argument( __FUNCTION__, '1.3' ); _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 * @return none
*/ */
function comments_link_feed() { 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 * @since 1.5.0
*/ */
function comment_link() { function comment_link() {
echo esc_url( get_comment_link() ); echo esc_url( apply_filters( 'comment_link', get_comment_link() ) );
} }
/** /**