WordPress.org

Make WordPress Core

Changeset 23624


Ignore:
Timestamp:
03/06/2013 07:57:31 PM (7 years ago)
Author:
nacin
Message:

Add filters to comments_link_feed(), comment_link(), and get_comments_link(). esc_url() the echoed output of comments_link().

props MarcusPope.
fixes #19210.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r22123 r23624  
    517517 */
    518518function get_comments_link($post_id = 0) {
    519     return get_permalink($post_id) . '#comments';
     519    return apply_filters( 'get_comments_link', get_permalink( $post_id ) . '#comments', $post_id );
    520520}
    521521
     
    533533    if ( !empty( $deprecated_2 ) )
    534534        _deprecated_argument( __FUNCTION__, '1.3' );
    535     echo get_comments_link();
     535    echo esc_url( get_comments_link() );
    536536}
    537537
  • trunk/wp-includes/feed.php

    r23591 r23624  
    199199 */
    200200function comments_link_feed() {
    201     echo esc_url( get_comments_link() );
     201    echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );
    202202}
    203203
     
    240240 */
    241241function comment_link() {
    242     echo esc_url( get_comment_link() );
     242    echo esc_url( apply_filters( 'comment_link', get_comment_link() ) );
    243243}
    244244
Note: See TracChangeset for help on using the changeset viewer.